diff --git a/src/store/modules/d2admin/modules/page.js b/src/store/modules/d2admin/modules/page.js index a0514502..0d109be6 100644 --- a/src/store/modules/d2admin/modules/page.js +++ b/src/store/modules/d2admin/modules/page.js @@ -214,6 +214,21 @@ export default { await router.push(routerObj) } }, + /** + * @class opened + * @description 关闭一个 tag (关闭一个页面) + * @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 关闭当前标签左边的标签