vue-router 跳转页面时,主路由还显示,解决方法

主要问题是你把路由引入成了公共底部

{
	path:'/home',
	name:'home',
	component:home
},

将其改成

{
	path:'/home',
	name:'home',
	component:home,
	meta:{
		index:0,
		showFooter:true
	}
}

然后在app.vue里加上 v-show="$route.meta.showFooter"

<router v-show="$route.meta.showFooter"></router>

二级页面,也就是将要跳转到的页面

{
	path:'/phonevalidation',
	name:'phonevalidation',
	component:phonevalidation,
	meta:{
		index:1,
		showFooter:false
	}
}

就大功告成啦

Logo

前往低代码交流专区

更多推荐