diff --git a/src/pages/demo/playground/store/page/index.vue b/src/pages/demo/playground/store/page/index.vue index a2ab5ade..42f31403 100644 --- a/src/pages/demo/playground/store/page/index.vue +++ b/src/pages/demo/playground/store/page/index.vue @@ -4,18 +4,31 @@

在下面的输入框输入任意字符后,切换到其它页面,再回到此页时输入框文字保留,证明被缓存

-

页签操作

- - - 关闭当前页 - +

关闭标签页

+ + + 当前 + + + 左侧 + + + 右侧 + + + 其它 + + + 全部 + +

刷新

- + 清空当前页缓存并刷新 - + 清空所有缓存并刷新 @@ -38,34 +51,53 @@ export default { 'keepAliveClean' ]), ...mapActions('d2admin/page', [ - 'close' + 'close', + 'closeLeft', + 'closeRight', + 'closeOther', + 'closeAll' ]), - // 关闭当前页 - closeCurrent () { + // 关闭当前 + handleCloseCurrent () { this.close({ tagName: this.$route.name, vm: this }) }, - // 刷新当前页面 - refreshCurrent () { - // const { path, query } = this.$route - // this.$router.replace({ - // path: '/redirect/' + JSON.stringify({ path, query }) - // }) - this.$router.replace({ - path: '/refresh' + // 关闭左侧 + handleCloseLeft () { + this.closeLeft({ + tagName: this.$route.name, + vm: this }) }, + // 关闭右侧 + handleCloseRight () { + this.closeRight({ + tagName: this.$route.name, + vm: this + }) + }, + // 关闭其他 + handleCloseOther () { + this.closeOther({ + tagName: this.$route.name, + vm: this + }) + }, + // 关闭全部 + handleCloseAll () { + this.closeAll(this) + }, // 清空当前页缓存并刷新此页面 - cleanCacheAndRefreshCurrent () { + handleCleanCacheAndRefreshCurrent () { this.keepAliveRemove(this.$route.name) - this.$nextTick(this.refreshCurrent) + this.$nextTick(this.$router.replace('/refresh')) }, // 清空所有的缓存并刷新此页面 - cleanCacheAndRefreshAll () { + handleCleanCacheAndRefreshAll () { this.keepAliveClean() - this.$nextTick(this.refreshCurrent) + this.$nextTick(this.$router.replace('/refresh')) } } }