mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-12 12:53:42 +08:00
30 lines
721 B
Vue
30 lines
721 B
Vue
<script setup lang="ts">
|
|
import { GLOBAL_HEADER_MENU_ID } from '@/constants/app';
|
|
import { useRouteStore } from '@/store/modules/route';
|
|
import { useRouterPush } from '@/hooks/common/router';
|
|
import { useMenu } from '../../../context';
|
|
|
|
defineOptions({
|
|
name: 'HorizontalMenu'
|
|
});
|
|
|
|
const routeStore = useRouteStore();
|
|
const { routerPushByKeyWithMetaQuery } = useRouterPush();
|
|
const { selectedKey } = useMenu();
|
|
</script>
|
|
|
|
<template>
|
|
<Teleport :to="`#${GLOBAL_HEADER_MENU_ID}`">
|
|
<NMenu
|
|
mode="horizontal"
|
|
:value="selectedKey"
|
|
:options="routeStore.menus"
|
|
:indent="18"
|
|
responsive
|
|
@update:value="routerPushByKeyWithMetaQuery"
|
|
/>
|
|
</Teleport>
|
|
</template>
|
|
|
|
<style scoped></style>
|