Former-commit-id: 9f39432718832530f47b6a9faee92afe1b9ac86d [formerly 9f39432718832530f47b6a9faee92afe1b9ac86d [formerly 9f39432718832530f47b6a9faee92afe1b9ac86d [formerly 9f39432718832530f47b6a9faee92afe1b9ac86d [formerly ecb763d008a589ee3b83854517804b1468ca7a09 [formerly b18b87cc41e0c54a93a2f5021fe6022a6fa2c5fb]]]]] Former-commit-id: 51a327f9f3d7a018f099f72ad564d6604aa5e9d7 Former-commit-id: 81c578d9cef74d8513c8a3c65107cfdfd3c6dfb7 Former-commit-id: caad4b29ff03d5878996ce52ff20252336128d97 [formerly 42d8aa2c0c3332d2c07057d6f4cdf21388c08fb9] Former-commit-id: a81ea126d2fa05ae5555f872669792a08f9f2ff0 Former-commit-id: d27d0e66ed023c621d2cd2711664f498a21bb8ad Former-commit-id: 61e0719ea25d0c67c1c38ded8cf41be50c17d7b5 Former-commit-id: 17291fab193dcf38a91f44137fa271d8f2d4ee56 Former-commit-id: 5218d72d35fb2d088198c37187d662eca768bd7b
106 lines
2.7 KiB
Vue
106 lines
2.7 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="handleCloseAll">
|
||
全部 <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,
|
||
vm: this
|
||
})
|
||
},
|
||
// 关闭左侧
|
||
handleCloseLeft () {
|
||
this.closeLeft({
|
||
tagName: this.$route.fullPath,
|
||
vm: this
|
||
})
|
||
},
|
||
// 关闭右侧
|
||
handleCloseRight () {
|
||
this.closeRight({
|
||
tagName: this.$route.fullPath,
|
||
vm: this
|
||
})
|
||
},
|
||
// 关闭其他
|
||
handleCloseOther () {
|
||
this.closeOther({
|
||
tagName: this.$route.fullPath,
|
||
vm: this
|
||
})
|
||
},
|
||
// 关闭全部
|
||
handleCloseAll () {
|
||
this.closeAll(this)
|
||
},
|
||
// 清空当前页缓存并刷新此页面
|
||
handleCleanCacheAndRefreshCurrent () {
|
||
this.keepAliveRemove(this.$route.fullPath)
|
||
this.$nextTick(this.$router.replace('/refresh'))
|
||
},
|
||
// 清空所有的缓存并刷新此页面
|
||
handleCleanCacheAndRefreshAll () {
|
||
this.keepAliveClean()
|
||
this.$nextTick(this.$router.replace('/refresh'))
|
||
}
|
||
}
|
||
}
|
||
</script>
|