作者 小范

新增tab组件拖动功能

... ... @@ -31,6 +31,7 @@
<script>
import Assembly from "@/views/bus/Assembly";
import Sortable from "sortablejs"
export default {
name: 'TabMenu',
... ... @@ -83,9 +84,27 @@
}
},
// changeView(val){
// if(val == 'table') {this.rowDrop()}
// this.initTab()
// },
rowDrop() {
const el= document.querySelector('.el-tabs__nav');
const _this = this;
Sortable.create(el, {
onEnd({ newIndex, oldIndex }) {
const currRow = _this.$store.state.openTab.splice(oldIndex, 1)[0]
_this.$store.state.openTab.splice(newIndex, 0, currRow)
}
})
},
},
mounted() {
this.initTab();
this.$nextTick(function () {
this.rowDrop(); //行拖拽效果
})
},
watch:{
'$route'(to,from){
... ...
{
"nmmsVer": "1.14"
"nmmsVer": "1.15"
}
... ...