用vue-wechat-title为微信动态设置标题
1、安装
npm install vue-wechat-title --save
2、在main.js中引入
Vue.use(require('vue-wechat-title'))
3、在路由里添加title属性
{
path: '/home',
title: '首页',
component: Home
}
4、在App.vue文件里添加如下代码:
// 控制微信标题
<router-view v-wechat-title="this.$route.meta.title"></router-view>