admin-vben/packages/@core/ui-kit/menu-ui/src/menu.vue

39 lines
793 B
Vue
Raw Normal View History

2024-05-19 13:20:42 +00:00
<script setup lang="ts">
import type { MenuRecordRaw } from '@vben-core/typings';
import type { MenuProps } from './types';
import { useForwardProps } from '@vben-core/composables';
2024-05-19 13:20:42 +00:00
import { Menu } from './components';
import SubMenu from './sub-menu.vue';
interface Props extends MenuProps {
menus: MenuRecordRaw[];
}
defineOptions({
2024-05-25 14:10:21 +00:00
name: 'MenuView',
2024-05-19 13:20:42 +00:00
});
const props = withDefaults(defineProps<Props>(), {
collapse: false,
// theme: 'dark',
});
const forward = useForwardProps(props);
// const emit = defineEmits<{
// 'update:openKeys': [key: Key[]];
// 'update:selectedKeys': [key: Key[]];
// }>();
</script>
<template>
<Menu v-bind="forward">
<template v-for="menu in menus" :key="menu.path">
<SubMenu :menu="menu" />
</template>
</Menu>
</template>