npm install vue-router --save-dev
定义一个index.js文件,编写路由插件
备注:在vue中使用router-link代替a标签;router-view是展示连接到路由的内容
vue-router路由
原文:https://www.cnblogs.com/yuruotianxin/p/14852531.html