Former-commit-id: 2b350f2c7dcabccf81332da56913ed5791b2630b [formerly 2b350f2c7dcabccf81332da56913ed5791b2630b [formerly 2b350f2c7dcabccf81332da56913ed5791b2630b [formerly 2b350f2c7dcabccf81332da56913ed5791b2630b [formerly fd209ad1a484e712fd0ea74ce7020098aead4242 [formerly 2c257cb405ccac096443bd2fdccbaae5b7a7336c]]]]] Former-commit-id: 434ea68625951aac6b0e831c27c269c4ee3aebf6 Former-commit-id: 9ac8deebf8637bdffe8a0db61c35c76ef2d0072b Former-commit-id: 16095a553ae10a98e0cbebdad85e31d0208e6326 [formerly eeb61bc0d3c1cce704fde0002c37dedae74b0238] Former-commit-id: 5ce017604d4ab2d59966ec0506d8169e1d5bedce Former-commit-id: d31d2b9eacc1a8babee74378e0e94dfd1ac9b2bd Former-commit-id: 11ef4d394329d103b6092cb54d582e27cf3f55c9 Former-commit-id: 565b6d70b1ccc2315074c7ee0b8a1b12b1aed997 Former-commit-id: 47dc611dc81999519ee3a87706b3beec4d70d414
98 lines
2.6 KiB
Vue
98 lines
2.6 KiB
Vue
<template>
|
||
<d2-container :filename="filename" type="card">
|
||
<!-- 证明有缓存 -->
|
||
<p class="d2-mt-0">在下面的输入框输入任意字符后,切换到其它页面,再回到此页时输入框文字保留,证明被缓存</p>
|
||
<el-input v-model="value" placeholder="input here"></el-input>
|
||
<!-- 页签操作 -->
|
||
<p>关闭标签页</p>
|
||
<el-button-group>
|
||
<el-button @click="handleCloseCurrent">
|
||
<d2-icon name="times"/> 当前
|
||
</el-button>
|
||
<el-button @click="handleCloseLeft">
|
||
<d2-icon name="arrow-left"/> 左侧
|
||
</el-button>
|
||
<el-button @click="handleCloseRight">
|
||
右侧 <d2-icon name="arrow-right"/>
|
||
</el-button>
|
||
<el-button @click="handleCloseOther">
|
||
其它 <d2-icon name="times"/>
|
||
</el-button>
|
||
<el-button @click="closeAll">
|
||
全部 <d2-icon name="times-circle"/>
|
||
</el-button>
|
||
</el-button-group>
|
||
<p>刷新</p>
|
||
<el-button-group>
|
||
<el-button @click="handleCleanCacheAndRefreshCurrent">
|
||
<d2-icon name="refresh"/>
|
||
清空当前页缓存并刷新
|
||
</el-button>
|
||
<el-button @click="handleCleanCacheAndRefreshAll">
|
||
<d2-icon name="refresh"/>
|
||
清空所有缓存并刷新
|
||
</el-button>
|
||
</el-button-group>
|
||
</d2-container>
|
||
</template>
|
||
|
||
<script>
|
||
import { mapMutations, mapActions } from 'vuex'
|
||
export default {
|
||
name: 'demo-playground-store-page',
|
||
data () {
|
||
return {
|
||
filename: __filename,
|
||
value: ''
|
||
}
|
||
},
|
||
methods: {
|
||
...mapMutations('d2admin/page', [
|
||
'keepAliveRemove',
|
||
'keepAliveClean'
|
||
]),
|
||
...mapActions('d2admin/page', [
|
||
'close',
|
||
'closeLeft',
|
||
'closeRight',
|
||
'closeOther',
|
||
'closeAll'
|
||
]),
|
||
// 关闭当前
|
||
handleCloseCurrent () {
|
||
this.close({
|
||
tagName: this.$route.fullPath
|
||
})
|
||
},
|
||
// 关闭左侧
|
||
handleCloseLeft () {
|
||
this.closeLeft({
|
||
tagName: this.$route.fullPath
|
||
})
|
||
},
|
||
// 关闭右侧
|
||
handleCloseRight () {
|
||
this.closeRight({
|
||
tagName: this.$route.fullPath
|
||
})
|
||
},
|
||
// 关闭其他
|
||
handleCloseOther () {
|
||
this.closeOther({
|
||
tagName: this.$route.fullPath
|
||
})
|
||
},
|
||
// 清空当前页缓存并刷新此页面
|
||
handleCleanCacheAndRefreshCurrent () {
|
||
this.keepAliveRemove(this.$route.fullPath)
|
||
this.$nextTick(this.$router.replace('/refresh'))
|
||
},
|
||
// 清空所有的缓存并刷新此页面
|
||
handleCleanCacheAndRefreshAll () {
|
||
this.keepAliveClean()
|
||
this.$nextTick(this.$router.replace('/refresh'))
|
||
}
|
||
}
|
||
}
|
||
</script>
|