diff --git a/packages/effects/layouts/src/authentication/authentication.vue b/packages/effects/layouts/src/authentication/authentication.vue index 0c79591e..40115458 100644 --- a/packages/effects/layouts/src/authentication/authentication.vue +++ b/packages/effects/layouts/src/authentication/authentication.vue @@ -17,6 +17,7 @@ interface Props { toolbar?: boolean; copyright?: boolean; toolbarList?: ToolbarType[]; + clickLogo?: () => void; } withDefaults(defineProps(), { @@ -28,6 +29,7 @@ withDefaults(defineProps(), { sloganImage: '', toolbar: true, toolbarList: () => ['color', 'language', 'layout', 'theme'], + clickLogo: () => {}, }); const { authPanelCenter, authPanelLeft, authPanelRight, isDark } = @@ -61,7 +63,11 @@ const { authPanelCenter, authPanelLeft, authPanelRight, isDark } = -
+
diff --git a/packages/effects/layouts/src/basic/layout.vue b/packages/effects/layouts/src/basic/layout.vue index 1fb90448..4a8e963a 100644 --- a/packages/effects/layouts/src/basic/layout.vue +++ b/packages/effects/layouts/src/basic/layout.vue @@ -34,7 +34,7 @@ import { LayoutTabbar } from './tabbar'; defineOptions({ name: 'BasicLayout' }); -const emit = defineEmits<{ clearPreferencesAndLogout: [] }>(); +const emit = defineEmits<{ clearPreferencesAndLogout: []; clickLogo: [] }>(); const { isDark, @@ -149,6 +149,10 @@ function clearPreferencesAndLogout() { emit('clearPreferencesAndLogout'); } +function clickLogo() { + emit('clickLogo'); +} + watch( () => preferences.app.layout, async (val) => { @@ -221,6 +225,7 @@ const headerSlots = computed(() => { :src="preferences.logo.source" :text="preferences.app.name" :theme="showHeaderNav ? headerTheme : theme" + @click="clickLogo" /> diff --git a/playground/src/layouts/auth.vue b/playground/src/layouts/auth.vue index 18d415bc..c33a632a 100644 --- a/playground/src/layouts/auth.vue +++ b/playground/src/layouts/auth.vue @@ -8,6 +8,7 @@ import { $t } from '#/locales'; const appName = computed(() => preferences.app.name); const logo = computed(() => preferences.logo.source); +const clickLogo = () => {};