Skip to content

Commit

Permalink
feature: 添加首页路由
Browse files Browse the repository at this point in the history
  • Loading branch information
jsxiaosi committed Jan 3, 2022
1 parent 2711520 commit 805e579
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/layouts/components/AppMain/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
height: calc(100vh - #{$navBarHeight+$BreadcrumbHeight+40px});
margin: 20px;
overflow: hidden;
background-color: #fff;
border-radius: 10px;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/modules/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const route = {
pathName: {
index: 'Home',
userInfo: 'UserInfo',
userList: 'UserList',
userDateil: 'UserDateil',
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-ch/modules/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const route = {
pathName: {
index: '首页',
userInfo: '用户管理',
userList: '用户列表',
userDateil: '用户详情',
Expand Down
24 changes: 17 additions & 7 deletions src/router/modules/otherRoute/otherRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,27 @@ const Layout = () => import('@/layouts/index.vue');
const AppMain = () => import('@/layouts/components/AppMain/index.vue');

const safeManagerRoutes: Array<AppRouteRecordRaw> = [
{
path: '',
component: Layout,
redirect: '/welcome',
name: 'home',
alwaysShow: false,
meta: { title: '', icon: 'iEL-home-filled' },
children: [
{
path: 'welcome',
name: 'welcome',
component: () => import('@/views/index/index.vue'),
meta: { title: t('route.pathName.index') },
},
],
},
{
path: '/useradmin',
component: Layout,
redirect: '/useradmin/userlist/',
name: '用户管理',
name: 'useradmin',
alwaysShow: true,
meta: { title: t('route.pathName.userInfo'), icon: 'iEL-avatar' },
children: [
Expand All @@ -22,12 +38,6 @@ const safeManagerRoutes: Array<AppRouteRecordRaw> = [
component: () => import('@/views/useradmin/userlist/index.vue'),
meta: { title: t('route.pathName.userList') },
},
{
path: 'index',
name: 'index',
component: () => import('@/views/index/index.vue'),
meta: { title: t('route.pathName.userDateil') },
},
],
},
{
Expand Down
9 changes: 4 additions & 5 deletions src/views/index/index.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<template>
<div>
index.js
<HelloWorld />
<div class="page-container">
<div class=""> </div>
</div>
</template>

<script setup>
// 直接导入组件
import HelloWorld from '@/components/HelloWorld.vue';
// import HelloWorld from '@/components/HelloWorld.vue';
// import { useContext } from 'vue'
// console.log(useContext())
</script>

<style></style>
<style lang="scss" scoped></style>

0 comments on commit 805e579

Please sign in to comment.