vue-router可以切换页面,能多页面跳转,也能单页面跳转,首先需要安装npm instal vue-router 如何下载npm太慢 可以搜索淘宝镜像设置cnpm,然后就会很快的,同时也需要导入vue也是通过vue.use(router);
export default new router(routes:[{}])属性有name,path,component,children,path是指router名字用于router-link to属性跳转,name用于this.$router.push({name:"",params:{}})页面跳转传参,component是组件名,
children是指路由比如 children:[{name:"",path:"/父级path名字/",component:""}],前面都是数组设置,router-view是默认加载第一个设置path:"/”,这就是设置单页面多路由的跳转。