修改项目中的title值

163 阅读1分钟

效果演示: 方法一:

  1. 在路由加上tile名称

2. 在main.js加上这些即可

方法二:

  1. 在路由加上tile名称

  2. 在App中中的mounted中,

 // 改变我的浏览器的名字
 document.head.childNodes[9].innerHTML = this.$route.meta.name

在watch监听中,

watch:{
<!--监听我的$route-->
  $route(){
    document.head.childNodes[9].innerHTML = this.$route.meta.name
  }
}