------------恢復內容開始------------
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;
})
------------恢復內容結束------------