[其他] 初始化项目结构

This commit is contained in:
就眠仪式
2021-09-27 06:09:33 +08:00
commit b2fa2b90b8
73 changed files with 9752 additions and 0 deletions

20
docs/src/router/index.ts Normal file
View File

@@ -0,0 +1,20 @@
import {
createMemoryHistory,
createRouter as _createRouter,
createWebHistory,
Router,
} from 'vue-router'
import zhCN from './zh-CN'
import type { IRouteRecordRaw } from '/@src/index'
const routes: IRouteRecordRaw[] = [...zhCN]
export function createRouter(): Router {
const baseUrl = import.meta.env.BASE_URL
return _createRouter({
history: import.meta.env.SSR
? createMemoryHistory(baseUrl)
: createWebHistory(baseUrl),
routes: routes
})
}

32
docs/src/router/zh-CN.ts Normal file
View File

@@ -0,0 +1,32 @@
import BaseLayout from '../layouts/Layout.vue'
const zhCN = [
{
path: '/',
redirect: '/zh-CN/guide/',
component: BaseLayout,
meta: { title: '指南', icon: 'el-icon-position' },
children: [
{
path: '/zh-CN/guide/',
component: () => import('../../docs/zh-CN/guide/home.md'),
meta: { title: '介绍' },
}
],
},
{
path: '/zh-CN/components/',
redirect: '/zh-CN/components/button',
component: BaseLayout,
meta: { title: '组件', icon: 'el-icon-copy-document' },
children: [
{
path: '/zh-CN/components/button',
component: () => import('../../docs/zh-CN/components/button.md'),
meta: { title: '按钮' },
}
],
},
]
export default zhCN