feat:简单Layout布局

This commit is contained in:
有来技术
2021-11-16 23:47:47 +08:00
parent 225fdd0175
commit 44e487bb97
6 changed files with 148 additions and 72 deletions

View File

@@ -1,17 +1,19 @@
import {createRouter, createWebHashHistory, RouteRecordRaw} from 'vue-router'
import HelloWord from '../components/HelloWorld.vue'
import Layout from '@/layout/index.vue'
const routes: Array<RouteRecordRaw> = [
{
path: '',
redirect: (_) => {
return {path: '/home'}
}
},
{
path: '/home',
name: 'HelloWord',
component: HelloWord
path: '/',
component: Layout,
redirect: '/dashboard',
children: [
{
path: 'dashboard',
component: () => import('@views/dashboard/index.vue'),
name: 'Dashboard',
meta: {title: '首页', icon: 'dashboard', affix: true}
}
]
}
]