This commit is contained in:
FairyEver
2019-12-15 00:45:37 +08:00
parent 45b1d7a95b
commit bf5d4ab6dd
60 changed files with 10823 additions and 25573 deletions
+19 -1
View File
@@ -113,6 +113,24 @@ export default {
resolve()
})
},
/**
* @class opened
* @description 重排页面列表上的某一项
* @param {Object} context
* @param {Object} payload { oldIndex, newIndex } 位置信息
*/
openedSort ({ state, commit, dispatch }, { oldIndex, newIndex }) {
return new Promise(async resolve => {
// 重排页面列表某一项
let page = state.opened[oldIndex]
state.opened.splice(oldIndex, 1)
state.opened.splice(newIndex, 0, page)
// 持久化
await dispatch('opened2db')
// end
resolve()
})
},
/**
* @class opened
* @description 新增一个 tag (打开一个页面)
@@ -402,7 +420,7 @@ export default {
const pool = []
const push = function (routes) {
routes.forEach(route => {
if (route.children) {
if (route.children && route.children.length > 0) {
push(route.children)
} else {
if (!route.hidden) {