mirror of
https://github.com/fugary/simple-element-plus-template.git
synced 2025-12-10 04:47:50 +00:00
优化目录结构,以及插件
This commit is contained in:
30
src/route/routes.js
Normal file
30
src/route/routes.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import HomeView from '@/views/HomeView.vue'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: HomeView,
|
||||
children: [{
|
||||
path: 'about',
|
||||
name: 'about',
|
||||
component: () => import('@/views/AboutView.vue')
|
||||
}, {
|
||||
path: 'personal',
|
||||
name: 'personal',
|
||||
component: () => import('@/views/PersonalInfo.vue')
|
||||
},
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
name: 'notFound',
|
||||
component: () => import('@/views/404.vue')
|
||||
}]
|
||||
}
|
||||
],
|
||||
scrollBehavior: () => ({ left: 0, top: 0 })
|
||||
})
|
||||
|
||||
export default router
|
||||
Reference in New Issue
Block a user