feat: 添加返回导航图标
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
parent
fb537fdc00
commit
ce445ae088
@ -267,6 +267,8 @@ interface WidgetPreferences {
|
|||||||
sidebarToggle: boolean;
|
sidebarToggle: boolean;
|
||||||
/** 是否显示主题切换部件 */
|
/** 是否显示主题切换部件 */
|
||||||
themeToggle: boolean;
|
themeToggle: boolean;
|
||||||
|
/** 是否显示返回导航部件 */
|
||||||
|
backNavigation: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Preferences {
|
interface Preferences {
|
||||||
|
@ -11,6 +11,7 @@ import {
|
|||||||
LanguageToggle,
|
LanguageToggle,
|
||||||
PreferencesButton,
|
PreferencesButton,
|
||||||
ThemeToggle,
|
ThemeToggle,
|
||||||
|
BackNavigation,
|
||||||
} from '../../widgets';
|
} from '../../widgets';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -43,7 +44,8 @@ const rightSlots = computed(() => {
|
|||||||
list.push({
|
list.push({
|
||||||
index: REFERENCE_VALUE,
|
index: REFERENCE_VALUE,
|
||||||
name: 'global-search',
|
name: 'global-search',
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preferencesButtonPosition.value.header) {
|
if (preferencesButtonPosition.value.header) {
|
||||||
@ -76,6 +78,12 @@ const rightSlots = computed(() => {
|
|||||||
name: 'notification',
|
name: 'notification',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (preferences.widget.backNavigation) {
|
||||||
|
list.push({
|
||||||
|
index: REFERENCE_VALUE + 60,
|
||||||
|
name: 'back-navigation',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Object.keys(slots).forEach((key) => {
|
Object.keys(slots).forEach((key) => {
|
||||||
const name = key.split('-');
|
const name = key.split('-');
|
||||||
@ -164,6 +172,9 @@ function clearPreferencesAndLogout() {
|
|||||||
<template v-else-if="slot.name === 'fullscreen'">
|
<template v-else-if="slot.name === 'fullscreen'">
|
||||||
<VbenFullScreen class="mr-1" />
|
<VbenFullScreen class="mr-1" />
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="slot.name === 'back-navigation'">
|
||||||
|
<BackNavigation class="mr-1" />
|
||||||
|
</template>
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
14
packages/effects/layouts/src/widgets/back-navigation.vue
Normal file
14
packages/effects/layouts/src/widgets/back-navigation.vue
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ArrowLeft } from '@vben/icons';
|
||||||
|
import { VbenIconButton } from '@vben-core/shadcn-ui';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
const router = useRouter();
|
||||||
|
const back = () => {
|
||||||
|
router.push('/navigation');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VbenIconButton @click="back">
|
||||||
|
<ArrowLeft></ArrowLeft>
|
||||||
|
</VbenIconButton>
|
||||||
|
</template>
|
@ -9,3 +9,4 @@ export * from './notification';
|
|||||||
export * from './preferences';
|
export * from './preferences';
|
||||||
export * from './theme-toggle';
|
export * from './theme-toggle';
|
||||||
export * from './user-dropdown';
|
export * from './user-dropdown';
|
||||||
|
export { default as BackNavigation } from './back-navigation.vue';
|
||||||
|
Loading…
Reference in New Issue
Block a user