How can the addRoutes method be used in other js files (such as util.js) in the vue-cli project? How to introduce router

router.addRoutes (routes);

I use router.addRoutes (routes); to report router is not defined in a js file

how to introduce router

I am using iview-admin

Mar.19,2021

introduces the js where you define the route


as referenced in your main.js .

Menu