mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-21 20:35:16 +00:00
36 lines
826 B
Vue
36 lines
826 B
Vue
<template>
|
|
<component :is="menuComponent" v-if="!routerInfo.hidden" :router-info="routerInfo">
|
|
<template v-if="routerInfo.children&&routerInfo.children.length">
|
|
<AsideComponent v-for="item in routerInfo.children" :key="item.name" :router-info="item" />
|
|
</template>
|
|
</component>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'AsideComponent',
|
|
}
|
|
</script>
|
|
|
|
<script setup>
|
|
import MenuItem from './menuItem.vue'
|
|
import AsyncSubmenu from './asyncSubmenu.vue'
|
|
import { computed, defineProps } from 'vue'
|
|
const props = defineProps({
|
|
routerInfo: {
|
|
type: Object,
|
|
default: () => null,
|
|
},
|
|
})
|
|
|
|
const menuComponent = computed(() => {
|
|
if (props.routerInfo.children && props.routerInfo.children.filter(item => !item.hidden).length) {
|
|
return AsyncSubmenu
|
|
} else {
|
|
return MenuItem
|
|
}
|
|
})
|
|
|
|
</script>
|
|
|