feat: add tagviews drag sort

This commit is contained in:
xieyuhang
2020-06-03 12:26:23 +08:00
parent 6f80263b42
commit 0a3a3d0e2d
3 changed files with 50 additions and 31 deletions

View File

@@ -63,6 +63,9 @@ const mutations = {
break
}
}
},
MOVE_VIEW: (state, { oldIndex, newIndex }) => {
state.visitedViews.splice(newIndex, 0, state.visitedViews.splice(oldIndex, 1)[0])
}
}
@@ -149,6 +152,9 @@ const actions = {
updateVisitedView({ commit }, view) {
commit('UPDATE_VISITED_VIEW', view)
},
moveView({ commit }, arg) {
commit('MOVE_VIEW', arg)
}
}