12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- import index from '../pages/index.vue'
- const getComponent = (component, dir) => () => import(`.././pages` + (dir ? `/${dir}` : '') + `/${component}.vue`);
- Vue.use(VueRouter)
- const routes = [
- {
- path: '/',
- name: 'index',
- component: index
- },
- {
- path: '/firstPay',
- name: 'firstPay',
- component: getComponent('firstPay'),
- }, {
- path: '/xy',
- name: 'xy',
- component: getComponent('xy'),
- },
- {
- path: '/secondPay',
- name: 'secondPay',
- component: getComponent('secondPay'),
- }, {
- path: '/thirdPay',
- name: 'thirdPay',
- component: getComponent('thirdPay'),
- },
- {
- path: '/payList',
- name: 'payList',
- component: getComponent('payList'),
- }
- ]
- const router = new VueRouter({
- routes
- })
- export default router
|