fix: layout error
This commit is contained in:
@@ -50,8 +50,8 @@
|
||||
"@vben-core/shadcn-ui": "workspace:*",
|
||||
"@vben-core/toolkit": "workspace:*",
|
||||
"@vben/locales": "workspace:*",
|
||||
"@vueuse/core": "^10.10.0",
|
||||
"@vueuse/integrations": "^10.10.0",
|
||||
"@vueuse/core": "^10.10.1",
|
||||
"@vueuse/integrations": "^10.10.1",
|
||||
"qrcode": "^1.5.3",
|
||||
"vue": "3.4.27",
|
||||
"vue-router": "^4.3.3"
|
||||
|
@@ -6,7 +6,7 @@ import { useRouter } from 'vue-router';
|
||||
|
||||
import { $t } from '@vben/locales';
|
||||
import { IcRoundClose, IcRoundSearchOff } from '@vben-core/iconify';
|
||||
import { ScrollArea, VbenIcon } from '@vben-core/shadcn-ui';
|
||||
import { VbenIcon, VbenScrollbar } from '@vben-core/shadcn-ui';
|
||||
import { mapTree, traverseTreeValues } from '@vben-core/toolkit';
|
||||
|
||||
import { onKeyStroke, useLocalStorage, useThrottleFn } from '@vueuse/core';
|
||||
@@ -214,7 +214,7 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ScrollArea>
|
||||
<VbenScrollbar>
|
||||
<div class="!flex h-full justify-center px-4 sm:max-h-[450px]">
|
||||
<!-- 无搜索结果 -->
|
||||
<div
|
||||
@@ -275,5 +275,5 @@ onMounted(() => {
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</VbenScrollbar>
|
||||
</template>
|
||||
|
@@ -7,10 +7,10 @@ import {
|
||||
IcRoundNotificationsNone,
|
||||
} from '@vben-core/iconify';
|
||||
import {
|
||||
ScrollArea,
|
||||
VbenButton,
|
||||
VbenIconButton,
|
||||
VbenPopover,
|
||||
VbenScrollbar,
|
||||
} from '@vben-core/shadcn-ui';
|
||||
|
||||
import { useToggle } from '@vueuse/core';
|
||||
@@ -81,7 +81,7 @@ function handleClick(item: NotificationItem) {
|
||||
</template>
|
||||
|
||||
<div class="relative">
|
||||
<div class="flex items-center justify-between border-b p-4 py-3">
|
||||
<div class="flex items-center justify-between p-4 py-3">
|
||||
<div class="text-foreground">{{ $t('widgets.notifications') }}</div>
|
||||
<VbenIconButton
|
||||
:tooltip="$t('widgets.make-all-as-read')"
|
||||
@@ -90,11 +90,11 @@ function handleClick(item: NotificationItem) {
|
||||
<IcRoundMarkEmailRead />
|
||||
</VbenIconButton>
|
||||
</div>
|
||||
<ScrollArea v-if="notifications.length > 0">
|
||||
<VbenScrollbar v-if="notifications.length > 0">
|
||||
<ul class="!flex max-h-[360px] w-full flex-col">
|
||||
<template v-for="item in notifications" :key="item.title">
|
||||
<li
|
||||
class="hover:bg-accent relative flex w-full cursor-pointer items-start gap-5 border-t px-3 py-3"
|
||||
class="hover:bg-accent border-border relative flex w-full cursor-pointer items-start gap-5 border-t px-3 py-3"
|
||||
@click="handleClick(item)"
|
||||
>
|
||||
<span
|
||||
@@ -123,7 +123,7 @@ function handleClick(item: NotificationItem) {
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
</ScrollArea>
|
||||
</VbenScrollbar>
|
||||
|
||||
<template v-else>
|
||||
<div class="flex-center text-muted-foreground min-h-[150px] w-full">
|
||||
@@ -131,7 +131,9 @@ function handleClick(item: NotificationItem) {
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="flex items-center justify-between border-t px-4 py-3">
|
||||
<div
|
||||
class="border-border flex items-center justify-between border-t px-4 py-3"
|
||||
>
|
||||
<VbenButton size="sm" variant="ghost" @click="handleClear">
|
||||
{{ $t('widgets.clear-notifications') }}
|
||||
</VbenButton>
|
||||
|
@@ -11,8 +11,8 @@ import {
|
||||
FullContent,
|
||||
HeaderNav,
|
||||
MixedNav,
|
||||
SideMixedNav,
|
||||
SideNav,
|
||||
SidebarMixedNav,
|
||||
SidebarNav,
|
||||
} from '../../icons';
|
||||
|
||||
interface PresetItem {
|
||||
@@ -25,26 +25,26 @@ defineOptions({
|
||||
name: 'PreferenceLayout',
|
||||
});
|
||||
|
||||
const modelValue = defineModel<LayoutType>({ default: 'side-nav' });
|
||||
const modelValue = defineModel<LayoutType>({ default: 'sidebar-nav' });
|
||||
|
||||
const components: Record<LayoutType, Component> = {
|
||||
'full-content': FullContent,
|
||||
'header-nav': HeaderNav,
|
||||
'mixed-nav': MixedNav,
|
||||
'side-mixed-nav': SideMixedNav,
|
||||
'side-nav': SideNav,
|
||||
'sidebar-mixed-nav': SidebarMixedNav,
|
||||
'sidebar-nav': SidebarNav,
|
||||
};
|
||||
|
||||
const PRESET = computed((): PresetItem[] => [
|
||||
{
|
||||
name: $t('preference.vertical'),
|
||||
tip: $t('preference.vertical-tip'),
|
||||
type: 'side-nav',
|
||||
type: 'sidebar-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preference.two-column'),
|
||||
tip: $t('preference.two-column-tip'),
|
||||
type: 'side-mixed-nav',
|
||||
type: 'sidebar-mixed-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preference.horizontal'),
|
||||
|
@@ -10,21 +10,21 @@ defineOptions({
|
||||
defineProps<{ disabled: boolean }>();
|
||||
|
||||
const sidebarEnable = defineModel<boolean>('sidebarEnable');
|
||||
const sidebarCollapseShowTitle = defineModel<boolean>(
|
||||
'sidebarCollapseShowTitle',
|
||||
const sidebarCollapsedShowTitle = defineModel<boolean>(
|
||||
'sidebarCollapsedShowTitle',
|
||||
);
|
||||
const sidebarCollapse = defineModel<boolean>('sidebarCollapse');
|
||||
const sidebarCollapsed = defineModel<boolean>('sidebarCollapsed');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<SwitchItem v-model="sidebarEnable" :disabled="disabled">
|
||||
{{ $t('preference.side-visible') }}
|
||||
</SwitchItem>
|
||||
<SwitchItem v-model="sidebarCollapse" :disabled="!sidebarEnable || disabled">
|
||||
<SwitchItem v-model="sidebarCollapsed" :disabled="!sidebarEnable || disabled">
|
||||
{{ $t('preference.collapse') }}
|
||||
</SwitchItem>
|
||||
<SwitchItem
|
||||
v-model="sidebarCollapseShowTitle"
|
||||
v-model="sidebarCollapsedShowTitle"
|
||||
:disabled="!sidebarEnable || disabled"
|
||||
>
|
||||
{{ $t('preference.collapse-show-title') }}
|
||||
|
@@ -3,8 +3,8 @@ import HeaderNav from './header-nav.vue';
|
||||
export { default as ContentCompact } from './content-compact.vue';
|
||||
export { default as FullContent } from './full-content.vue';
|
||||
export { default as MixedNav } from './mixed-nav.vue';
|
||||
export { default as SideMixedNav } from './side-mixed-nav.vue';
|
||||
export { default as SideNav } from './side-nav.vue';
|
||||
export { default as SidebarMixedNav } from './sidebar-mixed-nav.vue';
|
||||
export { default as SidebarNav } from './sidebar-nav.vue';
|
||||
|
||||
const ContentWide = HeaderNav;
|
||||
export { ContentWide, HeaderNav };
|
||||
|
@@ -22,7 +22,7 @@ import Preferences from './preferences.vue';
|
||||
:breadcrumb-hide-only-one="preferences.breadcrumb.hideOnlyOne"
|
||||
:breadcrumb-home="preferences.breadcrumb.showHome"
|
||||
:breadcrumb-icon="preferences.breadcrumb.showIcon"
|
||||
:breadcrumb-style="preferences.breadcrumb.styleType"
|
||||
:breadcrumb-style-type="preferences.breadcrumb.styleType"
|
||||
:color-primary-presets="COLOR_PRIMARY_RESETS"
|
||||
:footer-enable="preferences.footer.enable"
|
||||
:footer-fixed="preferences.footer.fixed"
|
||||
@@ -32,8 +32,8 @@ import Preferences from './preferences.vue';
|
||||
:navigation-split="preferences.navigation.split"
|
||||
:navigation-style-type="preferences.navigation.styleType"
|
||||
:shortcut-keys-enable="preferences.shortcutKeys.enable"
|
||||
:sidebar-collapse="preferences.sidebar.collapse"
|
||||
:sidebar-collapse-show-title="preferences.sidebar.collapseShowTitle"
|
||||
:sidebar-collapsed="preferences.sidebar.collapsed"
|
||||
:sidebar-collapsed-show-title="preferences.sidebar.collapsedShowTitle"
|
||||
:sidebar-enable="preferences.sidebar.enable"
|
||||
:tabbar-enable="preferences.tabbar.enable"
|
||||
:tabbar-show-icon="preferences.tabbar.showIcon"
|
||||
@@ -103,11 +103,11 @@ import Preferences from './preferences.vue';
|
||||
@update:shortcut-keys-enable="
|
||||
(val) => updatePreferences({ shortcutKeys: { enable: val } })
|
||||
"
|
||||
@update:sidebar-collapse="
|
||||
(val) => updatePreferences({ sidebar: { collapse: val } })
|
||||
@update:sidebar-collapsed="
|
||||
(val) => updatePreferences({ sidebar: { collapsed: val } })
|
||||
"
|
||||
@update:sidebar-collapse-show-title="
|
||||
(val) => updatePreferences({ sidebar: { collapseShowTitle: val } })
|
||||
@update:sidebar-collapsed-show-title="
|
||||
(val) => updatePreferences({ sidebar: { collapsedShowTitle: val } })
|
||||
"
|
||||
@update:sidebar-enable="
|
||||
(val) => updatePreferences({ sidebar: { enable: val } })
|
||||
|
@@ -70,9 +70,9 @@ const transitionEnable = defineModel<boolean>('transitionEnable');
|
||||
const themeColorPrimary = defineModel<string>('themeColorPrimary');
|
||||
|
||||
const sidebarEnable = defineModel<boolean>('sidebarEnable');
|
||||
const sidebarCollapse = defineModel<boolean>('sidebarCollapse');
|
||||
const sidebarCollapseShowTitle = defineModel<boolean>(
|
||||
'sidebarCollapseShowTitle',
|
||||
const sidebarCollapsed = defineModel<boolean>('sidebarCollapsed');
|
||||
const sidebarCollapsedShowTitle = defineModel<boolean>(
|
||||
'sidebarCollapsedShowTitle',
|
||||
);
|
||||
|
||||
const headerEnable = defineModel<boolean>('headerEnable');
|
||||
@@ -216,8 +216,8 @@ function handleReset() {
|
||||
|
||||
<Block :title="$t('preference.sidebar')">
|
||||
<Sidebar
|
||||
v-model:side-collapse-show-title="sidebarCollapseShowTitle"
|
||||
v-model:sidebar-collapse="sidebarCollapse"
|
||||
v-model:sidebar-collapsed="sidebarCollapsed"
|
||||
v-model:sidebar-collapsed-show-title="sidebarCollapsedShowTitle"
|
||||
v-model:sidebar-enable="sidebarEnable"
|
||||
:disabled="!isSideMode"
|
||||
/>
|
||||
|
Reference in New Issue
Block a user