Vue.js Vuejs试图在某些路由上禁用导航栏和页脚栏的全局组件

Vue.js Vuejs试图在某些路由上禁用导航栏和页脚栏的全局组件,vue.js,vuetify.js,nuxt.js,Vue.js,Vuetify.js,Nuxt.js,这是在某条路线上使用的代码,标题应替换为另一条 头棒代码: 内容 内容 mounted(){ if(this.$numxt.$route.path==='/page'){ this.otherHeader=true this.DesktopHeader=false }否则{ this.DesktopHeader=true this.otherHeader=false } } 默认布局代码: 内容 this.$route.path==='/page'?this.FooterHide=fa

这是在某条路线上使用的代码,标题应替换为另一条

头棒代码:


内容
内容
mounted(){
if(this.$numxt.$route.path==='/page'){
this.otherHeader=true
this.DesktopHeader=false
}否则{
this.DesktopHeader=true
this.otherHeader=false
}
}
默认布局代码:


内容
this.$route.path==='/page'?this.FooterHide=false:this.FooterHide=true

这在本地主机上有效,但在部署它时不起作用。

尝试将
This.$route.path
替换为
This.$numxt.$route.path

我还建议这样写:

this.FooterHide=this.$numxt.$route.path==='/page'?假:真
甚至

this.FooterHide=this.$numxt.$route.path!='/页面'

我解决了这个问题,车头杆部件是正确的,车头杆部件不工作。和我用指挥棒做的一样,它也起作用了。在部署时也没有注意到路由从“/page”更改为“/“page/”。

对于位于特定路由上的页脚栏,不应替换,而应删除