This commit is contained in:
FairyEver
2019-12-14 19:23:40 +08:00
parent ed9878c5f4
commit 0b2d11a61f
8 changed files with 44 additions and 7 deletions

View File

@@ -11,7 +11,7 @@
@rowClick="contextmenuClick"/>
</d2-contextmenu>
<el-tabs
class="d2-multiple-page-control"
class="d2-multiple-page-control d2-multiple-page-sort"
:value="current"
type="card"
:closable="true"
@@ -60,6 +60,7 @@
<script>
import { mapState, mapActions } from 'vuex'
import Sortable from 'sortablejs'
export default {
components: {
D2Contextmenu: () => import('../contextmenu'),
@@ -94,7 +95,8 @@ export default {
'closeLeft',
'closeRight',
'closeOther',
'closeAll'
'closeAll',
'openedSort'
]),
/**
* @description 右键菜单功能点击
@@ -172,6 +174,15 @@ export default {
})
}
}
},
mounted () {
const el = document.querySelectorAll('.d2-multiple-page-sort .el-tabs__nav')[0]
Sortable.create(el, {
onEnd: (evt) => {
const { oldIndex, newIndex } = evt
this.openedSort({ oldIndex, newIndex })
}
})
}
}
</script>