vue change title

Generally divided into two cases,

The first advance that you have defined a title, such as home ah what,

Second, you can not confirm, such as a watch page article, this title is the title of the article, you can not know in advance is that users get the article.

The first:

1-1, first we need to set the title to the routing

1-2, the following code is written in the file main.js 

The second:

2-1, to install a plug (not installed cnpm use NPM)

cnpm install vue-wechat-title --save

2-2, configure main.js

2-3, with v-wechat-title = "this.title" on the first page you need to change a div, title again the following data which is defined by the data.

 2-4, dynamically change the title

Guess you like

Origin www.cnblogs.com/hjsblogs/p/10980633.html
Recommended