import Router from 'vue-router' import Vue from "vue"; Vue.use(Router); let routes = [ { path: '/', name: 'Home', redirect: '/home' }, { path: '/home', name: 'Home', component: function (resolve) { require(["@/pages/home/index.vue"], resolve); }, children: [ { path: 'login', name: 'Login', component: function (resolve) { require(["@/pages/login/index.vue"], resolve); }, }, { path: 'patientlist', name: 'Patientlist', component: function (resolve) { require(["@/pages/patientlist/index.vue"], resolve); }, }, { path: 'patientdetail', name: 'Patientdetail', component: function (resolve) { require(["@/pages/patientdetail/index.vue"], resolve); } }, ] }, { path: '/settingwin', name: 'Settingwin', component: function (resolve) { require(["@/pages/settingwin/index.vue"], resolve); }, }, { path: '/update', name: 'Update', component: function (resolve) { require(["@/pages/update/index.vue"], resolve); }, }, // { // path: '/newwin', // name: 'Newwin', // component: import('../pages/newwin/index.vue') // }, // { // path: '/404', // name: 'not-found', // component: import('../pages/404.vue') // }, // { // path: '/:pathMatch(.*)', // redirect: '/404' // } ] console.log(routes) const originalPush = Router.prototype.push Router.prototype.push = function push(location) { return originalPush.call(this, location).catch((err) => err) } let router = new Router({ mode: 'hash', base: __dirname, routes, }) export default router