路由相关信息

this.router 是路由,这个就跟 main.js 种的 router 中是一样的,里面有 router中所有的东西

main.js 中的router 是用 import 引入的,其他地方 使用$router 是因为在main.js中引入后 把这个router 挂在了vue的原型上,就可以在任何组件中使用了

如果你想在单独的 js 文件中使用router 就需要你用 import 引入一下

你可能感兴趣的:(路由相关信息)