Merge branch 'hotfix/page演示'
Former-commit-id: 9f5be0d3d6ff1ec7dc7b82306d7836a5cd572eb3 [formerly 9f5be0d3d6ff1ec7dc7b82306d7836a5cd572eb3 [formerly 9f5be0d3d6ff1ec7dc7b82306d7836a5cd572eb3 [formerly 9f5be0d3d6ff1ec7dc7b82306d7836a5cd572eb3 [formerly 51e1c80d94d56131ab6331e1332ece005e1f0f4e [formerly 44fbe77c499c4db5da0d40b64122e0137ce9ccf9]]]]] Former-commit-id: 989053e324b5b1413c121af46f7807033da8be86 Former-commit-id: 2c860a13dc3682228052ccf60e0693673b2b0a75 Former-commit-id: 457b638ae56bc1e7a8f3ce3e323605ff32e4f731 [formerly 013c24a9251a78cd78c2df337f15b444f06f4ad2] Former-commit-id: c3a93be77077f69ed6fb6530ea8001b8d625c3ba Former-commit-id: b905a8cd758b35816ce369103ee22b6797079ad5 Former-commit-id: c7a32171d771104269016bcdac8977b201f5132c Former-commit-id: 9459f8c6edb1c7af15e027f36a7c729d993a792c Former-commit-id: 83bee7d6ad5b698a8187f0facdd76ef4dac77785
This commit is contained in:
@@ -40,10 +40,7 @@ export default {
|
|||||||
// 清空缓存设置
|
// 清空缓存设置
|
||||||
this.pageKeepAliveClean()
|
this.pageKeepAliveClean()
|
||||||
// 刷新此页面
|
// 刷新此页面
|
||||||
const { path, query } = this.$route
|
this.$router.replace('/refresh')
|
||||||
this.$router.replace({
|
|
||||||
path: '/redirect/' + JSON.stringify({ path, query })
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
|
|||||||
@@ -6,3 +6,11 @@
|
|||||||
<el-button type="primary" @click="$router.push({ name: 'demo-playground-page-argu-send' })">返回发送数据的页面</el-button>
|
<el-button type="primary" @click="$router.push({ name: 'demo-playground-page-argu-send' })">返回发送数据的页面</el-button>
|
||||||
</d2-container>
|
</d2-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
mounted () {
|
||||||
|
console.log('this.$route', this.$route)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -1,16 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<d2-container type="card">
|
<d2-container type="card">
|
||||||
|
<!-- 证明有缓存 -->
|
||||||
|
<p class="d2-mt-0">在下面的输入框输入任意字符后,切换到其它页面,再回到此页时输入框文字保留,证明被缓存</p>
|
||||||
|
<el-input v-model="value" placeholder="input here"></el-input>
|
||||||
|
<!-- 页签操作 -->
|
||||||
|
<p>页签操作</p>
|
||||||
<el-button @click="closeCurrent" type="danger">
|
<el-button @click="closeCurrent" type="danger">
|
||||||
<d2-icon name="times"/>
|
<d2-icon name="times"/>
|
||||||
关闭当前页
|
关闭当前页
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<p>刷新</p>
|
||||||
|
<el-button-group>
|
||||||
|
<el-button @click="cleanCacheAndRefreshCurrent">
|
||||||
|
<d2-icon name="refresh"/>
|
||||||
|
清空当前页缓存并刷新
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="cleanCacheAndRefreshAll">
|
||||||
|
<d2-icon name="refresh"/>
|
||||||
|
清空所有缓存并刷新
|
||||||
|
</el-button>
|
||||||
|
</el-button-group>
|
||||||
</d2-container>
|
</d2-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions } from 'vuex'
|
import { mapMutations, mapActions } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
|
name: 'demo-playground-store-page',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
value: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapMutations('d2admin/page', [
|
||||||
|
'keepAliveRemove',
|
||||||
|
'keepAliveClean'
|
||||||
|
]),
|
||||||
...mapActions('d2admin/page', [
|
...mapActions('d2admin/page', [
|
||||||
'close'
|
'close'
|
||||||
]),
|
]),
|
||||||
@@ -20,6 +46,26 @@ export default {
|
|||||||
tagName: this.$route.name,
|
tagName: this.$route.name,
|
||||||
vm: this
|
vm: this
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 刷新当前页面
|
||||||
|
refreshCurrent () {
|
||||||
|
// const { path, query } = this.$route
|
||||||
|
// this.$router.replace({
|
||||||
|
// path: '/redirect/' + JSON.stringify({ path, query })
|
||||||
|
// })
|
||||||
|
this.$router.replace({
|
||||||
|
path: '/refresh'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 清空当前页缓存并刷新此页面
|
||||||
|
cleanCacheAndRefreshCurrent () {
|
||||||
|
this.keepAliveRemove(this.$route.name)
|
||||||
|
this.$nextTick(this.refreshCurrent)
|
||||||
|
},
|
||||||
|
// 清空所有的缓存并刷新此页面
|
||||||
|
cleanCacheAndRefreshAll () {
|
||||||
|
this.keepAliveClean()
|
||||||
|
this.$nextTick(this.refreshCurrent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default {
|
|||||||
component: layoutHeaderAside,
|
component: layoutHeaderAside,
|
||||||
children: (pre => [
|
children: (pre => [
|
||||||
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/playground/index'), meta: { ...meta, title: '试验台首页' } },
|
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/playground/index'), meta: { ...meta, title: '试验台首页' } },
|
||||||
{ path: 'store/page', name: `${pre}store-page`, component: () => import('@/pages/demo/playground/store/page'), meta: { ...meta, title: '多标签页控制' } },
|
{ path: 'store/page', name: `${pre}store-page`, component: () => import('@/pages/demo/playground/store/page'), meta: { ...meta, cache: true, title: '多标签页控制' } },
|
||||||
{ path: 'store/menu', name: `${pre}store-menu`, component: () => import('@/pages/demo/playground/store/menu'), meta: { ...meta, title: '菜单控制' } },
|
{ path: 'store/menu', name: `${pre}store-menu`, component: () => import('@/pages/demo/playground/store/menu'), meta: { ...meta, title: '菜单控制' } },
|
||||||
{ path: 'store/size', name: `${pre}store-size`, component: () => import('@/pages/demo/playground/store/size'), meta: { ...meta, title: '全局尺寸' } },
|
{ path: 'store/size', name: `${pre}store-size`, component: () => import('@/pages/demo/playground/store/size'), meta: { ...meta, title: '全局尺寸' } },
|
||||||
{ path: 'store/ua', name: `${pre}store-ua`, component: () => import('@/pages/demo/playground/store/ua'), meta: { ...meta, title: '浏览器信息' } },
|
{ path: 'store/ua', name: `${pre}store-ua`, component: () => import('@/pages/demo/playground/store/ua'), meta: { ...meta, title: '浏览器信息' } },
|
||||||
|
|||||||
@@ -20,11 +20,36 @@ const frameIn = [
|
|||||||
redirect: { name: 'index' },
|
redirect: { name: 'index' },
|
||||||
component: layoutHeaderAside,
|
component: layoutHeaderAside,
|
||||||
children: [
|
children: [
|
||||||
|
// 首页 必须 name:index
|
||||||
{
|
{
|
||||||
path: 'index',
|
path: 'index',
|
||||||
name: 'index',
|
name: 'index',
|
||||||
meta,
|
meta,
|
||||||
component: () => import('@/pages/index')
|
component: () => import('@/pages/index')
|
||||||
|
},
|
||||||
|
// 刷新页面 必须保留
|
||||||
|
{
|
||||||
|
path: 'refresh',
|
||||||
|
name: 'refresh',
|
||||||
|
hidden: true,
|
||||||
|
component: {
|
||||||
|
beforeRouteEnter (to, from, next) {
|
||||||
|
next(vm => vm.$router.replace(from.fullPath))
|
||||||
|
},
|
||||||
|
render: h => h()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 页面重定向 必须保留
|
||||||
|
{
|
||||||
|
path: 'redirect/:route*',
|
||||||
|
name: 'redirect',
|
||||||
|
hidden: true,
|
||||||
|
component: {
|
||||||
|
beforeRouteEnter (to, from, next) {
|
||||||
|
next(vm => vm.$router.replace(JSON.parse(from.params.route)))
|
||||||
|
},
|
||||||
|
render: h => h()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -42,19 +67,6 @@ const frameIn = [
|
|||||||
* 在主框架之外显示
|
* 在主框架之外显示
|
||||||
*/
|
*/
|
||||||
const frameOut = [
|
const frameOut = [
|
||||||
// 页面重定向使用 必须保留
|
|
||||||
{
|
|
||||||
path: '/redirect/:path*',
|
|
||||||
component: {
|
|
||||||
beforeCreate () {
|
|
||||||
const path = this.$route.params.path
|
|
||||||
this.$router.replace(JSON.parse(path))
|
|
||||||
},
|
|
||||||
render: function (h) {
|
|
||||||
return h()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 登录
|
// 登录
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
963a1923bc8b0876a15c930bd0f9cc2105cba4a7
|
b640559cb03d106f8ed74403b61a7af0561e5015
|
||||||
Reference in New Issue
Block a user