Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
"dependencies": {
|
||||
"@vben-core/shared": "workspace:*",
|
||||
"@vueuse/core": "^11.0.3",
|
||||
"radix-vue": "^1.9.4",
|
||||
"radix-vue": "^1.9.5",
|
||||
"sortablejs": "^1.15.2",
|
||||
"vue": "^3.4.38"
|
||||
},
|
||||
|
@@ -184,9 +184,6 @@ const headerFixed = computed(() => {
|
||||
});
|
||||
|
||||
const showSidebar = computed(() => {
|
||||
// if (isMixedNav.value && !props.sideHidden) {
|
||||
// return false;
|
||||
// }
|
||||
return isSideMode.value && sidebarEnable.value;
|
||||
});
|
||||
|
||||
|
@@ -49,7 +49,7 @@
|
||||
"@vueuse/core": "^11.0.3",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"lucide-vue-next": "^0.436.0",
|
||||
"radix-vue": "^1.9.4",
|
||||
"radix-vue": "^1.9.5",
|
||||
"vue": "^3.4.38"
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ interface Props {
|
||||
contentClass?: any;
|
||||
contentStyle?: StyleValue;
|
||||
delayDuration?: number;
|
||||
side: TooltipContentProps['side'];
|
||||
side?: TooltipContentProps['side'];
|
||||
}
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
@@ -33,7 +33,7 @@ withDefaults(defineProps<Props>(), {
|
||||
:class="contentClass"
|
||||
:side="side"
|
||||
:style="contentStyle"
|
||||
class="side-content text-popover-foreground bg-popover"
|
||||
class="side-content text-popover-foreground bg-accent rounded-md"
|
||||
>
|
||||
<slot></slot>
|
||||
</TooltipContent>
|
||||
|
@@ -1,3 +1,5 @@
|
||||
export * from './ellipsis-text';
|
||||
export * from './page';
|
||||
export * from '@vben-core/popup-ui';
|
||||
|
||||
export { VbenButton } from '@vben-core/shadcn-ui';
|
||||
|
@@ -161,7 +161,7 @@ defineExpose({ resetCaptcha });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div @keypress.enter.prevent="handleSubmit">
|
||||
<div @keydown.enter.prevent="handleSubmit">
|
||||
<Title>
|
||||
{{ title || `${$t('authentication.welcomeBack')} 👋🏻` }}
|
||||
<template #desc>
|
||||
|
@@ -27,6 +27,8 @@ withDefaults(defineProps<Props>(), {
|
||||
theme: 'light',
|
||||
});
|
||||
|
||||
const emit = defineEmits<{ clearPreferencesAndLogout: [] }>();
|
||||
|
||||
const accessStore = useAccessStore();
|
||||
const { globalSearchShortcutKey, preferencesButtonPosition } = usePreferences();
|
||||
const slots = useSlots();
|
||||
@@ -90,6 +92,10 @@ const leftSlots = computed(() => {
|
||||
});
|
||||
return list.sort((a, b) => a.index - b.index);
|
||||
});
|
||||
|
||||
function clearPreferencesAndLogout() {
|
||||
emit('clearPreferencesAndLogout');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -123,7 +129,10 @@ const leftSlots = computed(() => {
|
||||
</template>
|
||||
|
||||
<template v-else-if="slot.name === 'preferences'">
|
||||
<PreferencesButton class="mr-2" />
|
||||
<PreferencesButton
|
||||
class="mr-2"
|
||||
@clear-preferences-and-logout="clearPreferencesAndLogout"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="slot.name === 'theme-toggle'">
|
||||
<ThemeToggle class="mr-2 mt-[2px]" />
|
||||
|
@@ -78,23 +78,17 @@ const isMenuRounded = computed(() => {
|
||||
});
|
||||
|
||||
const logoCollapsed = computed(() => {
|
||||
const shouldCollapse = isHeaderNav.value || isMixedNav.value;
|
||||
|
||||
if (shouldCollapse) {
|
||||
if (isMobile.value) {
|
||||
return true;
|
||||
}
|
||||
if (isHeaderNav.value || isMixedNav.value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const shouldExpandOnMobile = !sidebarCollapsed.value && isMobile.value;
|
||||
|
||||
if (shouldExpandOnMobile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return sidebarCollapsed.value || isSideMixedNav.value;
|
||||
});
|
||||
|
||||
const showHeaderNav = computed(() => {
|
||||
return isHeaderNav.value || isMixedNav.value;
|
||||
return !isMobile.value && (isHeaderNav.value || isMixedNav.value);
|
||||
});
|
||||
|
||||
// 侧边多列菜单
|
||||
@@ -208,7 +202,10 @@ const headerSlots = computed(() => {
|
||||
</template>
|
||||
<!-- 头部区域 -->
|
||||
<template #header>
|
||||
<LayoutHeader :theme="theme">
|
||||
<LayoutHeader
|
||||
:theme="theme"
|
||||
@clear-preferences-and-logout="clearPreferencesAndLogout"
|
||||
>
|
||||
<template
|
||||
v-if="!showHeaderNav && preferences.breadcrumb.enable"
|
||||
#breadcrumb
|
||||
|
@@ -3,9 +3,15 @@ import { Settings } from '@vben/icons';
|
||||
import { VbenIconButton } from '@vben-core/shadcn-ui';
|
||||
|
||||
import Preferences from './preferences.vue';
|
||||
|
||||
const emit = defineEmits<{ clearPreferencesAndLogout: [] }>();
|
||||
|
||||
function clearPreferencesAndLogout() {
|
||||
emit('clearPreferencesAndLogout');
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<Preferences>
|
||||
<Preferences @clear-preferences-and-logout="clearPreferencesAndLogout">
|
||||
<VbenIconButton>
|
||||
<Settings class="size-4" />
|
||||
</VbenIconButton>
|
||||
|
@@ -413,7 +413,6 @@ async function handleReset() {
|
||||
variant="ghost"
|
||||
@click="handleClearCache"
|
||||
>
|
||||
<!-- <RotateCw class="mr-2 size-4" /> -->
|
||||
{{ $t('preferences.clearAndLogout') }}
|
||||
</VbenButton>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user