mirror of
https://gitee.com/novel_dev_team/novel-front-web
synced 2026-07-20 17:54:10 +08:00
32 lines
712 B
JavaScript
32 lines
712 B
JavaScript
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
|
|
const router = createRouter({
|
|
// createWebHistory 路由模式路径不带#号(生产环境下不能直接访问项目,需要 nginx 转发)
|
|
// createWebHashHistory 路由模式路径带#号
|
|
history: createWebHashHistory(),
|
|
routes: [
|
|
{
|
|
path: '/',
|
|
redirect: '/home'
|
|
},
|
|
{
|
|
path: '/home',
|
|
name: 'home',
|
|
component: () => import('@/views/Home')
|
|
|
|
},
|
|
{
|
|
path: '/home',
|
|
name: 'newsContent',
|
|
component: () => import('@/views/Home')
|
|
},
|
|
{
|
|
path: '/book/:id',
|
|
name: 'book',
|
|
component: () => import('@/views/Book')
|
|
|
|
}
|
|
]
|
|
})
|
|
|
|
export default router |