2020
10-09
10-09
vue 实现把路由单独分离出来
建立一个router.js文件引入importVuefrom'vue'importVueRouterfrom'vue-router'importHomefrom'../components/home/home.vue'然后注册Vue.use(VueRouter);constrouter=newVueRouter({mode:'history',base:__dirname,routes:[{path:historyUrl+'/',component:Home,name:'主页'},]}最后暴露出云exportdefaultrouter在main.js里面直接引入然后就可以用了importrouterfrom'./main...
继续阅读 >