vue 监听 路由 meta的变化
2021-01-20 18:14
标签:监听 strong -- mount bsp this root 恢复 vue ------------恢复内容开始------------ 1.配置路由 { } 2,在mount里面赋值 mounted(){ 3,由于在页面上刷新才可以显示,所一需要watch监听 watch: { 3.0的监听watch(()=>root.$route,(to,from)=>{ state.title=to.matched; }) ------------恢复内容结束------------ vue 监听 路由 meta的变化 标签:监听 strong -- mount bsp this root 恢复 vue 原文地址:https://www.cnblogs.com/xzhce/p/13307087.html
path: ‘/hellow‘,
name:"hellow",
component: hellow,
meta:{title:"hellow"}
this.title=this.$route.matched;
},
‘$route.matched‘: function (newVal, oldVal) {
this.title=this.$route.matched;
}
},