mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2025-05-17 17:49:25 +08:00
47 lines
855 B
JavaScript
47 lines
855 B
JavaScript
import Vue from 'vue'
|
|
import Router from 'vue-router'
|
|
|
|
Vue.use(Router)
|
|
export const constantRoutes = [
|
|
{
|
|
path: '/',
|
|
redirect: '/account'
|
|
},
|
|
{
|
|
path: '/account',
|
|
name: 'account',
|
|
component: () => import('@/views/account/index'),
|
|
meta: {
|
|
title: '个人中心',
|
|
keepAlive: false
|
|
}
|
|
},
|
|
{
|
|
path: '/coupon',
|
|
name: 'coupon',
|
|
component: () => import('@/views/account/coupon'),
|
|
meta: {
|
|
title: '优惠券',
|
|
keepAlive: false
|
|
}
|
|
},
|
|
{
|
|
path: '/home',
|
|
name: 'home',
|
|
component: () => import('@/views/home/index'),
|
|
meta: {
|
|
keepAlive: false
|
|
}
|
|
}
|
|
]
|
|
|
|
const createRouter = () =>
|
|
new Router({
|
|
mode: 'history', // require service support
|
|
base: '/antpublic',
|
|
scrollBehavior: () => ({ y: 0 }),
|
|
routes: constantRoutes
|
|
})
|
|
|
|
export default createRouter()
|