feat: Preferences support clearing the cache and logging out

This commit is contained in:
vben
2024-07-06 14:41:18 +08:00
parent 37a4f971c8
commit 1425f1d11d
9 changed files with 265 additions and 231 deletions

View File

@@ -28,6 +28,8 @@ import { Breadcrumb } from './widgets';
defineOptions({ name: 'BasicLayout' });
const emit = defineEmits<{ clearPreferencesAndLogout: [] }>();
const { isDark, isHeaderNav, isMixedNav, isSideMixedNav, layout } =
usePreferences();
@@ -106,6 +108,10 @@ function toggleSidebar() {
},
});
}
function clearPreferencesAndLogout() {
emit('clearPreferencesAndLogout');
}
</script>
<template>
@@ -147,7 +153,9 @@ function toggleSidebar() {
"
>
<template v-if="preferences.app.showPreference" #preferences>
<PreferencesWidget />
<PreferencesWidget
@clear-preferences-and-logout="clearPreferencesAndLogout"
/>
</template>
<template #floating-groups>