javascript - How to set web page title keyword description in vue2.0
世界只因有你2017-06-26 10:52:29
0
2
1026
How to set the keywords and descriptions in the webpage title and meta tag in vue2.0? If you want to dynamically change, switch routes or other situations, dynamically change these three places
The basic tags of the entry file can be manipulated You can operate the DOM in Router router.beforeEach((to, from, next) => { //Manipulate DOM here // ... /* console. log(to); console.log(from);*/ next(); })
Set as follows in router.js
The basic tags of the entry file can be manipulated
You can operate the DOM in Router
router.beforeEach((to, from, next) => {
//Manipulate DOM here
// ...
/* console. log(to);
console.log(from);*/
next();
})