From 3e496015f5551d426d89e0f3084cd92ba4fbed1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=8F=8F?= Date: Wed, 26 Aug 2020 10:25:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=A0=87=E9=A2=98=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/d2admin/modules/page.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 关闭当前标签左边的标签