if you want to use the meta field data in router in other js files or vuex, how to introduce it?
import router from". / router"
cannot be used after this introduction
if you want to use the meta field data in router in other js files or vuex, how to introduce it?
import router from". / router"
cannot be used after this introduction
solved, it's on the prototype chain of vue, but it's not very elegant.
< hr >it still doesn't work. Console.log (router.app) comes out as undefined, but there is
in console.log (router).introduces main.js. It is then referenced from the vue instance exposed in main.js. Either route or vuex is fine.
have you solved it? I have the same problem. When introduced, undefind
this is how I get the current routing path in vuex. I hope it will be helpful to you.
import router from '@/router'
console.log('=>',router.app._route.name);
as shown in the figure, are there any ideas or ready-made plug-ins? elementUI looked at it and found that it could not support dynamic component switching. ...
rt; now there are two pages An and B, in which page A has a watch listening, and page b is empty. When I switch routes, first switch from page A to page B, and then switch back to page A, then the function in watch will be triggered twice. Continu...