Merge pull request #303 from wangjue666/master

feat:  增加修改标签标题的方法
This commit is contained in:
李杨
2020-08-26 13:33:29 +08:00
committed by GitHub

View File

@@ -214,6 +214,21 @@ export default {
await router.push(routerObj)
}
},
/**
* @class opened
* @description 更新一个 tag title
* @param {Object} context
* @param {Object} payload { tagName: 要更新的标签名字, title: 新的标签名字 }
*/
update ({ state }, { tagName, title }) {
const index = state.opened.findIndex(page => page.fullPath === tagName)
if (index === 0) {
return
}
if (title && state.opened[index]) {
state.opened[index].meta.title = title
}
},
/**
* @class opened
* @description 关闭当前标签左边的标签