feat: init
This commit is contained in:
36
frontend/wechat/src/router.js
Normal file
36
frontend/wechat/src/router.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
component: () => import('@/layouts/MainLayout.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'home',
|
||||
component: () => import('@/views/ArticleList.vue'),
|
||||
meta: { keepAlive: true }
|
||||
},
|
||||
{
|
||||
path: 'purchased',
|
||||
name: 'purchased',
|
||||
component: () => import('@/views/PurchasedArticles.vue')
|
||||
},
|
||||
{
|
||||
path: 'profile',
|
||||
name: 'profile',
|
||||
component: () => import('@/views/UserProfile.vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/article/:id',
|
||||
name: 'article-detail',
|
||||
component: () => import('@/views/ArticleDetail.vue')
|
||||
}
|
||||
]
|
||||
|
||||
export const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes
|
||||
})
|
||||
Reference in New Issue
Block a user