路由配置 增加 fullpage 整页路由配置
This commit is contained in:
parent
f7c89bc669
commit
2ed0f5cd70
|
@ -99,7 +99,7 @@
|
|||
},
|
||||
//增加tag
|
||||
addViewTags(route) {
|
||||
if(route.name){
|
||||
if(route.name && !route.meta.fullpage){
|
||||
this.$store.commit("pushViewTags",route)
|
||||
this.$store.commit("pushKeepLive",route.name)
|
||||
}
|
||||
|
|
|
@ -53,7 +53,11 @@ router.beforeEach(async (to, from, next) => {
|
|||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//整页路由处理
|
||||
if(to.meta.fullpage){
|
||||
to.matched = [to.matched[to.matched.length-1]]
|
||||
}
|
||||
//加载API路由
|
||||
if(!isGetApiRouter){
|
||||
let menu = tool.data.get("MENU");
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<el-page-header content="FullPage" @back="goBack" />
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-empty description="FullPageMain"></el-empty>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'fullpage',
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
goBack(){
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -23,6 +23,10 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card shadow="never" header="整页路由" style="margin-top: 15px;">
|
||||
<el-button type="primary" plain @click="fullpage">fullpage</el-button>
|
||||
<el-alert title="变更路由的层级关系,向上推至顶级达到在layout视图中显示. 只需要在路由中设置 meta.fullpage 即可" style="margin-top: 20px;"></el-alert>
|
||||
</el-card>
|
||||
</el-main>
|
||||
</template>
|
||||
|
||||
|
@ -66,6 +70,9 @@
|
|||
},
|
||||
set1(){
|
||||
useTabs.setTitle(this.input)
|
||||
},
|
||||
fullpage(){
|
||||
this.$router.push('/other/fullpage')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue