feat: preference button supports automatic positioning (#4243)

This commit is contained in:
Vben
2024-08-26 23:17:27 +08:00
committed by GitHub
parent dc5cfab319
commit d2f3a9d04f
11 changed files with 57 additions and 17 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>