«Vue 将路由分散到不同的文件»
by pluvet on Jan 10, 2019

app.js(new Vue的那个js)

import Router from './routes.js'

routes.js

const tpl_dir = '/assets/tpl/';
export const Router = new VueRouter({
  routes: [
    {
      path: '/login',
      component: httpVueLoader(tpl_dir+'login.vue'),
    }
  ]
});
export default Router;

关键是这个export.

添加新评论