------------恢复内容开始------------

 

 

 

1.配置路由

{
path: '/hellow',
name:"hellow",
component: hellow,
meta:{title:"hellow"}

}

2,在mount里面赋值

mounted(){
   this.title=this.$route.matched;
},

 

3,由于在页面上刷新才可以显示,所一需要watch监听 

watch: {
'$route.matched': function (newVal, oldVal) {
this.title=this.$route.matched;
}
},

 

3.0的监听watch(()=>root.$route,(to,from)=>{

 

state.title=to.matched;

})

 

------------恢复内容结束------------

posted on 2020-07-15 18:04  心意如水hucuie22  阅读(1144)  评论(0编辑  收藏  举报