Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix sort and toggle in tableSetting.
Types of changes
Background and context
list/search-table/index.vue
该示例表格右上角提供自选显示列和自定义列排序,但有缺憾:
1、当取消多个勾时实际只取消最后一个,重新勾上会导致出现重复列。
2、排序算法与drag的页面效果不符,页面显示效果是其他字段前移或后移,但代码结果是前后位置的两个列直接交换。
Solution
1、使用showColumns作为母本直接重新生成列配置
2、使用splice方式把旧下标的元素插入新下标前,取代原来交换的方式
How is the change tested?
本地dev测试
Changelog
Checklist:
feature
branch and others should be submitted tomaster
branch)Other information