This commit is contained in:
dap
2024-08-27 08:14:19 +08:00
72 changed files with 374 additions and 138 deletions

View File

@@ -28,7 +28,7 @@ withDefaults(defineProps<Props>(), {
});
const accessStore = useAccessStore();
const { globalSearchShortcutKey } = usePreferences();
const { globalSearchShortcutKey, preferencesButtonPosition } = usePreferences();
const slots = useSlots();
const rightSlots = computed(() => {
const list = [{ index: 100, name: 'user-dropdown' }];
@@ -39,10 +39,7 @@ const rightSlots = computed(() => {
});
}
if (
preferences.app.enablePreferences &&
preferences.app.preferencesButtonPosition === 'header'
) {
if (preferencesButtonPosition.value.header) {
list.push({
index: 10,
name: 'preferences',
@@ -121,7 +118,7 @@ const leftSlots = computed(() => {
<GlobalSearch
:enable-shortcut-key="globalSearchShortcutKey"
:menus="accessStore.accessMenus"
class="mr-4"
class="mr-1 sm:mr-4"
/>
</template>

View File

@@ -40,6 +40,7 @@ const {
isMobile,
isSideMixedNav,
layout,
preferencesButtonPosition,
sidebarCollapsed,
theme,
} = usePreferences();
@@ -326,12 +327,7 @@ const headerSlots = computed(() => {
<slot v-if="lockStore.isLockScreen" name="lock-screen"></slot>
</Transition>
<template
v-if="
preferences.app.enablePreferences &&
preferences.app.preferencesButtonPosition === 'fixed'
"
>
<template v-if="preferencesButtonPosition.fixed">
<Preferences
class="z-100 fixed bottom-20 right-0"
@clear-preferences-and-logout="clearPreferencesAndLogout"

View File

@@ -127,7 +127,7 @@ onMounted(() => {
@click="toggleOpen()"
>
<Search
class="text-muted-foreground group-hover:text-foreground size-3 group-hover:opacity-100"
class="text-muted-foreground group-hover:text-foreground size-4 group-hover:opacity-100"
/>
<span
class="text-muted-foreground group-hover:text-foreground hidden text-xs duration-300 md:block"

View File

@@ -159,7 +159,7 @@ function toggleUnlockForm() {
</transition>
<div
class="enter-y absolute bottom-5 w-full text-center text-gray-300 xl:text-xl 2xl:text-3xl"
class="enter-y absolute bottom-5 w-full text-center xl:text-xl 2xl:text-3xl"
>
<div v-if="showUnlockForm" class="enter-x mb-2 text-3xl">
{{ hour }}:{{ minute }} <span class="text-lg">{{ meridiem }}</span>

View File

@@ -24,6 +24,10 @@ const appPreferencesButtonPosition = defineModel<string>(
);
const positionItems = computed((): SelectOption[] => [
{
label: $t('preferences.position.auto'),
value: 'auto',
},
{
label: $t('preferences.position.header'),
value: 'header',

View File

@@ -55,7 +55,7 @@ const listen = computed(() => {
</script>
<template>
<div>
<Drawer v-bind="attrs" v-on="listen" />
<Drawer v-bind="{ ...$attrs, ...attrs }" v-on="listen" />
<div @click="() => drawerApi.open()">
<slot>