2024-05-19 21:20:42 +08:00
|
|
|
<script lang="ts" setup>
|
2024-07-23 00:03:59 +08:00
|
|
|
import { preferences, usePreferences } from '@vben/preferences';
|
|
|
|
import { useCoreAccessStore } from '@vben/stores';
|
2024-05-19 21:20:42 +08:00
|
|
|
import { VbenFullScreen } from '@vben-core/shadcn-ui';
|
|
|
|
|
2024-07-09 22:49:36 +08:00
|
|
|
import { GlobalSearch, LanguageToggle, ThemeToggle } from '../../widgets';
|
|
|
|
|
2024-05-19 21:20:42 +08:00
|
|
|
interface Props {
|
|
|
|
/**
|
|
|
|
* Logo 主题
|
|
|
|
*/
|
|
|
|
theme?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
name: 'LayoutHeader',
|
|
|
|
});
|
|
|
|
|
|
|
|
withDefaults(defineProps<Props>(), {
|
|
|
|
theme: 'light',
|
|
|
|
});
|
|
|
|
|
2024-07-05 23:15:46 +08:00
|
|
|
const accessStore = useCoreAccessStore();
|
2024-06-16 13:43:33 +08:00
|
|
|
const { globalSearchShortcutKey } = usePreferences();
|
2024-05-19 21:20:42 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="flex-center hidden lg:block">
|
|
|
|
<slot name="breadcrumb"></slot>
|
|
|
|
</div>
|
|
|
|
<div class="flex h-full min-w-0 flex-1 items-center">
|
|
|
|
<slot name="menu"></slot>
|
|
|
|
</div>
|
|
|
|
<div class="flex h-full min-w-0 flex-shrink-0 items-center">
|
2024-05-25 20:02:21 +08:00
|
|
|
<GlobalSearch
|
2024-07-10 21:20:11 +08:00
|
|
|
v-if="preferences.widget.globalSearch"
|
2024-06-16 13:43:33 +08:00
|
|
|
:enable-shortcut-key="globalSearchShortcutKey"
|
2024-07-10 00:50:41 +08:00
|
|
|
:menus="accessStore.accessMenus"
|
2024-06-09 13:31:43 +08:00
|
|
|
class="mr-4"
|
2024-05-25 20:02:21 +08:00
|
|
|
/>
|
2024-07-10 21:20:11 +08:00
|
|
|
<ThemeToggle v-if="preferences.widget.themeToggle" class="mr-2" />
|
|
|
|
<LanguageToggle v-if="preferences.widget.languageToggle" class="mr-2" />
|
|
|
|
<VbenFullScreen v-if="preferences.widget.fullscreen" class="mr-2" />
|
|
|
|
<slot v-if="preferences.widget.notification" name="notification"></slot>
|
2024-05-19 21:20:42 +08:00
|
|
|
<slot name="user-dropdown"></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|