+
+
+
+
+
{{ item }}
+
+
+
@@ -49,12 +67,19 @@ export default {
},
data() {
return {
- sortList: []
+ sortList: [],
+ searchText: ''
}
},
computed: {
panelInfo() {
return this.$store.state.panel.panelInfo
+ },
+ filterList() {
+ if (!this.searchText) {
+ return this.sortList
+ }
+ return this.sortList.filter(item => item?.includes(this.searchText))
}
},
watch: {
@@ -72,7 +97,13 @@ export default {
this.onUpdate()
})
},
- onMove() {
+ moveToTop(index, item) {
+ let targetIndex = index
+ if (this.searchText) {
+ targetIndex = this.sortList.findIndex(i => i === item)
+ }
+ const [target] = this.sortList.splice(targetIndex, 1)
+ this.sortList.unshift(target)
},
onUpdate() {
this.$emit('onSortChange', this.sortList)
@@ -98,7 +129,10 @@ export default {
display: flex;
align-items: center;
}
-
+.item-dimension .to-top {
+ display: none;
+ cursor: pointer;
+}
.item-icon{
cursor: move;
margin: 0 2px;
@@ -129,6 +163,9 @@ export default {
border-color: #a3d3ff;
cursor: pointer;
}
+.item-dimension:hover .to-top {
+ display: block;
+}
.blackTheme .item-dimension:hover {
color: var(--Main);