create project vue
This commit is contained in:
parent
243cb707ee
commit
03b6076835
58 changed files with 15606 additions and 1 deletions
60
src/router/index.ts
Normal file
60
src/router/index.ts
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import HomeView from '../views/HomeView.vue'
|
||||
import Meta01 from '@/modules/01_meta/router'
|
||||
import Meta02 from '@/modules/02_meta/router'
|
||||
|
||||
const MainLayout = () => import('@/views/MainLayout.vue')
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: MainLayout,
|
||||
children: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'dashboard',
|
||||
component: HomeView,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [7]
|
||||
}
|
||||
},
|
||||
...Meta01,
|
||||
...Meta02
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 404 Not Found
|
||||
* ref: https://router.vuejs.org/guide/essentials/dynamic-matching.html#catch-all-404-not-found-route
|
||||
*/
|
||||
// {
|
||||
// // path: "/:catchAll(.*)*", // TODO: ใช้ pathMatch แทนตามในเอกสารแนะนำ คงไว้เผื่อจำเป็น
|
||||
// path: "/:pathMatch(.*)*",
|
||||
// component: Error404NotFound,
|
||||
// },
|
||||
]
|
||||
})
|
||||
|
||||
// const router = createRouter({
|
||||
// history: createWebHistory(import.meta.env.BASE_URL),
|
||||
// routes: [
|
||||
// {
|
||||
// path: '/',
|
||||
// name: 'home',
|
||||
// component: HomeView
|
||||
// },
|
||||
// {
|
||||
// path: '/about',
|
||||
// name: 'about',
|
||||
// // route level code-splitting
|
||||
// // this generates a separate chunk (About.[hash].js) for this route
|
||||
// // which is lazy-loaded when the route is visited.
|
||||
// component: () => import('../views/AboutView.vue')
|
||||
// }
|
||||
// ]
|
||||
// })
|
||||
|
||||
export default router
|
||||
Loading…
Add table
Add a link
Reference in a new issue