vue项目使用vue-router

vue-router官方网址  https://router.vuejs.org/zh/

 

1、进入项目目录安装vue-router

 

2、在src目录下创建一个新的目录为router

 

3、在router目录下分别创建index.js && router.config.js

 

4、router.config.js下

   

 

  这的路由页面的title可参考:https://www.cnblogs.com/niningwei/p/9234841.html 

 

 

5、index.js下

 

 

6 、在main.js 中引入router 并挂载在vue上

 

posted on 2018-06-27 16:27  倪贰大爷  阅读(2009)  评论(0编辑  收藏  举报

导航