You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
<!--
|
|
* 传统菜单-递归菜单
|
|
|
|
-->
|
|
<template>
|
|
<a-sub-menu :key="menuInfo.menuId">
|
|
<template #icon>
|
|
<component :is="$antIcons[menuInfo.icon]" />
|
|
</template>
|
|
<template #title>{{ menuInfo.menuName }}</template>
|
|
<template v-for="item in menuInfo.children" :key="item.menuId">
|
|
<template v-if="item.visibleFlag && !item.disabledFlag">
|
|
<template v-if="!item.children">
|
|
<a-menu-item :key="item.menuId" @click="turnToPage(item)">
|
|
<template #icon>
|
|
<component :is="$antIcons[item.icon]" />
|
|
</template>
|
|
{{ item.menuName }}
|
|
</a-menu-item>
|
|
</template>
|
|
<template v-else>
|
|
<SubMenu :menu-info="item" :key="item.menuId" @turnToPage="turnToPage" />
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</a-sub-menu>
|
|
</template>
|
|
<script setup>
|
|
const props = defineProps({
|
|
menuInfo: {
|
|
type: Object,
|
|
default: () => ({}),
|
|
},
|
|
});
|
|
|
|
const emits = defineEmits(['turnToPage']);
|
|
const turnToPage = (menu) => {
|
|
emits('turnToPage', menu);
|
|
};
|
|
</script>
|
|
|