style:增加左侧导航及头部导航栏

This commit is contained in:
李晓鸽
2022-09-28 18:33:52 +08:00
commit f416bb7da8
37 changed files with 20589 additions and 0 deletions

16
src/router/config.js Normal file
View File

@@ -0,0 +1,16 @@
const routes = [];
const context = require.context('@/views', true, /\.vue$/, 'lazy');
context.keys().forEach(path => {
// console.log('path', path)
const componentName = path.replace(/.*\/([^\\.\\/]*)\.vue$/, '$1');
routes.push({
path: `/${componentName.toLowerCase()}`,
name: componentName,
component: () => context(path),
meta: {
isLink: true
}
});
});
export default routes;

19
src/router/index.js Normal file
View File

@@ -0,0 +1,19 @@
import { createRouter, createWebHashHistory } from 'vue-router';
import routesConfig from './config';
// console.log('routesConfig', routesConfig)
const routes = [
{
path: '/',
name: '首页',
redirect: routesConfig[0].path
},
...routesConfig
]
const router = createRouter({
history: createWebHashHistory(),
routes
})
export default router