parent
2b6262e98f
commit
712e4518a9
10 changed files with 193 additions and 40 deletions
@ -0,0 +1,67 @@ |
||||
<template> |
||||
<!-- 根据路由动态生成菜单 --> |
||||
<template v-for="item in menuList" :key="item.path"> |
||||
<!-- 没有子路由 --> |
||||
<template v-if="!item.children"> |
||||
<el-menu-item |
||||
v-if="!item.meta.hidden" |
||||
:index="item.path" |
||||
@click="goToRoute" |
||||
> |
||||
<!-- <el-icon> |
||||
<component :is="item.meta.icon"></component> |
||||
</el-icon> --> |
||||
<template #title> |
||||
<!-- <el-icon> |
||||
<component :is="item.meta.icon"></component> |
||||
</el-icon> --> |
||||
<span>{{ item.meta.title }}</span> |
||||
</template> |
||||
</el-menu-item> |
||||
</template> |
||||
<!-- 有子路由但是只有一个子路由 --> |
||||
<template v-if="item.children && item.children.length === 1"> |
||||
<el-menu-item |
||||
v-if="!item.children[0].meta.hidden" |
||||
:index="item.children[0].path" |
||||
@click="goToRoute" |
||||
> |
||||
<el-icon> |
||||
<component :is="item.children[0].meta.icon"></component> |
||||
</el-icon> |
||||
<template #title> |
||||
<span>{{ item.children[0].meta.title }}</span> |
||||
</template> |
||||
</el-menu-item> |
||||
</template> |
||||
<!-- 有子路由且有多个 --> |
||||
<el-sub-menu |
||||
:index="item.path" |
||||
v-if="item.children && item.children.length > 1" |
||||
> |
||||
<template #title> |
||||
<el-icon> |
||||
<component :is="item.meta.icon"></component> |
||||
</el-icon> |
||||
<span>{{ item.meta.title }}</span> |
||||
</template> |
||||
<Item :menuList="item.children" /> |
||||
</el-sub-menu> |
||||
</template> |
||||
</template> |
||||
<script lang="ts" setup> |
||||
import { useRouter } from 'vue-router' |
||||
// import { onMounted, reactive, ref, toRefs, watch } from 'vue' |
||||
// 获取父组件传递的全部的路由的数据 |
||||
defineProps(['menuList']) |
||||
const $router = useRouter() |
||||
const goToRoute = (vc: any) => { |
||||
$router.push(vc.index) |
||||
} |
||||
</script> |
||||
<script lang="ts"> |
||||
export default { |
||||
name: 'app-Menu', |
||||
} |
||||
</script> |
||||
<style lang="scss" scoped></style> |
@ -0,0 +1,16 @@ |
||||
import request from '@/utils/requset' |
||||
|
||||
// 获取年度比赛项目列表
|
||||
export const getRaceProjectList = (params:any) => { |
||||
return request({ |
||||
url:'/AnnualCompPoint/annualCompPoint/listStudent', |
||||
params |
||||
}) |
||||
} |
||||
// 获取年度比赛列表
|
||||
export const getRaceList = (params:any) => { |
||||
return request({ |
||||
url:'/annualcomp/annualComp/schoollist', |
||||
params |
||||
}) |
||||
} |
After Width: | Height: | Size: 2.2 MiB |
After Width: | Height: | Size: 821 KiB |
After Width: | Height: | Size: 247 KiB |
@ -0,0 +1,12 @@ |
||||
<template> |
||||
<div class="container-1420">1</div> |
||||
</template> |
||||
|
||||
<script lang='ts' setup> |
||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue' |
||||
|
||||
</script> |
||||
|
||||
<style lang='scss' scoped> |
||||
|
||||
</style> |
Loading…
Reference in new issue