1.安装插件
cnpm install vue-wechat-title --save
2.在main.js中引入
Vue.use(require('vue-wechat-title'))
3.在路由里添加name属性:
{
name: 'home',
path: '/home',
meta: {
title: '宜居'
},
component: resolve => { require(['@/views/home/index'], resolve) }
}
4.在App.vue文件里添加如下代码:
<div v-wechat-title="$route.name"></div> <!--控制微信标题的-->
网友评论