47 lines
1.1 KiB
Vue
47 lines
1.1 KiB
Vue
<template>
|
|
<template v-for="menu in props.menuList" :key="menu.menu_id">
|
|
<a-sub-menu
|
|
class="mymenu"
|
|
v-if="menu.menu_type== 1 && menu.children"
|
|
:key="menu.path"
|
|
>
|
|
<template #icon>
|
|
<component :is="menu.icon" v-if="menu.icon"/>
|
|
</template>
|
|
<template #title>
|
|
<div v-if="menu.menu_title=='医生配置' || menu.menu_title=='科普文章管理'" style="margin-left:-16px;">{{ menu.menu_title }}</div>
|
|
<span v-else>{{ menu.menu_title }}</span>
|
|
</template>
|
|
<sub-menu :menuList="menu.children" />
|
|
</a-sub-menu>
|
|
<a-menu-item
|
|
v-if="menu.menu_type== 2 && isRouteParams(menu.path)"
|
|
:key="menu.path"
|
|
>{{ menu.menu_title }}</a-menu-item>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
import { computed } from 'vue'
|
|
|
|
const props = defineProps({
|
|
menuList: {
|
|
type: Array,
|
|
default: () => [],
|
|
},
|
|
});
|
|
|
|
// 判断是否路由需要带参匹配
|
|
const isRouteParams = computed(() => {
|
|
return (path) => {
|
|
if (path.indexOf(':') == -1) return true;
|
|
return false;
|
|
}
|
|
})
|
|
</script>
|
|
<style scoped >
|
|
:deep(.mymenu .arco-menu-title ) {
|
|
overflow: inherit!important;
|
|
|
|
}
|
|
</style>
|