chore: format code

This commit is contained in:
vben
2024-06-09 13:31:43 +08:00
parent 68229a4d2f
commit 35c3dd78ec
65 changed files with 419 additions and 494 deletions

View File

@@ -28,12 +28,12 @@ const appName = computed(() => preferences.app.name);
<div class="absolute left-0 top-0 z-10 flex flex-1">
<div
class="text-foreground ml-4 mt-4 flex flex-1 items-center sm:left-6 sm:top-6"
:class="
authPanelLeft || authPanelCenter
? 'lg:text-foreground'
: 'lg:text-white'
"
class="text-foreground ml-4 mt-4 flex flex-1 items-center sm:left-6 sm:top-6"
>
<img
:alt="appName"

View File

@@ -14,7 +14,7 @@ defineOptions({
</slot>
<RouterView v-slot="{ Component, route }">
<Transition name="slide-right" mode="out-in" appear>
<Transition appear mode="out-in" name="slide-right">
<KeepAlive :include="['Login']">
<component
:is="Component"

View File

@@ -41,11 +41,11 @@ function getTransitionName(route: RouteLocationNormalizedLoaded) {
<template>
<IFrameRouterView />
<RouterView v-slot="{ Component, route }">
<Transition :name="getTransitionName(route)" mode="out-in" appear>
<Transition :name="getTransitionName(route)" appear mode="out-in">
<KeepAlive
v-if="keepAlive"
:include="getCacheTabs"
:exclude="getExcludeTabs"
:include="getCacheTabs"
>
<component
:is="Component"

View File

@@ -31,9 +31,9 @@ const accessStore = useAccessStore();
</div>
<div class="flex h-full min-w-0 flex-shrink-0 items-center">
<GlobalSearch
class="mr-4"
:enable-shortcut-key="preferences.shortcutKeys.enable"
:menus="accessStore.getAccessMenus"
class="mr-4"
/>
<ThemeToggle class="mr-2" />
<LanguageToggle class="mr-2" />

View File

@@ -103,56 +103,38 @@ function wrapperMenus(menus: MenuRecordRaw[]) {
<template>
<VbenAdminLayout
v-model:side-extra-visible="extraVisible"
:side-extra-collapse="preferences.sidebar.extraCollapse"
:side-expand-on-hover="preferences.sidebar.expandOnHover"
:side-collapse="preferences.sidebar.collapse"
:side-collapse-show-title="preferences.sidebar.collapseShowTitle"
:content-compact="preferences.app.contentCompact"
:footer-enable="preferences.footer.enable"
:footer-fixed="preferences.footer.fixed"
:header-hidden="preferences.header.hidden"
:header-mode="preferences.header.mode"
:header-visible="preferences.header.enable"
:is-mobile="preferences.app.isMobile"
:layout="layout"
:header-mode="preferences.header.mode"
:footer-fixed="preferences.footer.fixed"
:side-collapse="preferences.sidebar.collapse"
:side-collapse-show-title="preferences.sidebar.collapseShowTitle"
:side-expand-on-hover="preferences.sidebar.expandOnHover"
:side-extra-collapse="preferences.sidebar.extraCollapse"
:side-hidden="preferences.sidebar.hidden"
:side-semi-dark="preferences.app.semiDarkMenu"
:side-theme="theme"
:side-hidden="preferences.sidebar.hidden"
:side-visible="sideVisible"
:footer-visible="preferences.footer.enable"
:header-visible="preferences.header.enable"
:header-hidden="preferences.header.hidden"
:side-width="preferences.sidebar.width"
:tabs-visible="preferences.tabbar.enable"
@update:side-extra-collapse="
(value: boolean) =>
updatePreferences({
sidebar: {
extraCollapse: value,
},
})
@side-mouse-leave="handleSideMouseLeave"
@update:side-collapse="
(value: boolean) => updatePreferences({ sidebar: { collapse: value } })
"
@update:side-expand-on-hover="
(value: boolean) =>
updatePreferences({
sidebar: {
expandOnHover: value,
},
})
updatePreferences({ sidebar: { expandOnHover: value } })
"
@update:side-collapse="
@update:side-extra-collapse="
(value: boolean) =>
updatePreferences({
sidebar: {
collapse: value,
},
})
updatePreferences({ sidebar: { extraCollapse: value } })
"
@side-mouse-leave="handleSideMouseLeave"
@update:side-visible="
(value: boolean) =>
updatePreferences({
sidebar: {
enable: value,
},
})
(value: boolean) => updatePreferences({ sidebar: { enable: value } })
"
>
<template v-if="preferences.app.showPreference" #preferences>
@@ -167,12 +149,12 @@ function wrapperMenus(menus: MenuRecordRaw[]) {
<!-- logo -->
<template #logo>
<VbenLogo
:alt="preferences.app.name"
:class="logoClass"
:collapse="logoCollapse"
:src="preferences.logo.source"
:text="preferences.app.name"
:theme="showHeaderNav ? headerMenuTheme : theme"
:alt="preferences.app.name"
:class="logoClass"
/>
</template>
<!-- 头部区域 -->
@@ -184,19 +166,19 @@ function wrapperMenus(menus: MenuRecordRaw[]) {
>
<Breadcrumb
:hide-when-only-one="preferences.breadcrumb.hideOnlyOne"
:type="preferences.breadcrumb.styleType"
:show-icon="preferences.breadcrumb.showIcon"
:show-home="preferences.breadcrumb.showHome"
:show-icon="preferences.breadcrumb.showIcon"
:type="preferences.breadcrumb.styleType"
/>
</template>
<template v-if="showHeaderNav" #menu>
<LayoutMenu
class="w-full"
:rounded="isMenuRounded"
mode="horizontal"
:theme="headerMenuTheme"
:menus="wrapperMenus(headerMenus)"
:default-active="headerActive"
:menus="wrapperMenus(headerMenus)"
:rounded="isMenuRounded"
:theme="headerMenuTheme"
class="w-full"
mode="horizontal"
@select="handleMenuSelect"
/>
</template>
@@ -211,44 +193,44 @@ function wrapperMenus(menus: MenuRecordRaw[]) {
<!-- 侧边菜单区域 -->
<template #menu>
<LayoutMenu
mode="vertical"
:accordion="preferences.navigation.accordion"
:rounded="isMenuRounded"
:collapse-show-title="preferences.sidebar.collapseShowTitle"
:collapse="preferences.sidebar.collapse"
:theme="theme"
:menus="wrapperMenus(sideMenus)"
:collapse-show-title="preferences.sidebar.collapseShowTitle"
:default-active="sideActive"
:menus="wrapperMenus(sideMenus)"
:rounded="isMenuRounded"
:theme="theme"
mode="vertical"
@select="handleMenuSelect"
/>
</template>
<template #mixed-menu>
<LayoutMixedMenu
:rounded="isMenuRounded"
:collapse="!preferences.sidebar.collapseShowTitle"
:active-path="extraActiveMenu"
:collapse="!preferences.sidebar.collapseShowTitle"
:rounded="isMenuRounded"
:theme="theme"
@select="handleMixedMenuSelect"
@default-select="handleDefaultSelect"
@enter="handleMenuMouseEnter"
@select="handleMixedMenuSelect"
/>
</template>
<!-- 侧边额外区域 -->
<template #side-extra>
<LayoutExtraMenu
:accordion="preferences.navigation.accordion"
:rounded="isMenuRounded"
:menus="wrapperMenus(extraMenus)"
:collapse="preferences.sidebar.extraCollapse"
:menus="wrapperMenus(extraMenus)"
:rounded="isMenuRounded"
:theme="theme"
/>
</template>
<template #side-extra-title>
<VbenLogo
v-if="preferences.logo.enable"
:alt="preferences.app.name"
:text="preferences.app.name"
:theme="theme"
:alt="preferences.app.name"
/>
</template>

View File

@@ -27,11 +27,11 @@ async function handleSelect(key: string) {
<template>
<Menu
:rounded="rounded"
:accordion="accordion"
:collapse="collapse"
:default-active="route.path"
:menus="menus"
:rounded="rounded"
:theme="theme"
mode="vertical"
@select="handleSelect"

View File

@@ -23,14 +23,14 @@ function handleMenuSelect(key: string) {
<template>
<Menu
:rounded="rounded"
:collapse-show-title="collapseShowTitle"
:collapse="collapse"
:accordion="accordion"
:collapse="collapse"
:collapse-show-title="collapseShowTitle"
:default-active="defaultActive"
:menus="menus"
:theme="theme"
:mode="mode"
:rounded="rounded"
:theme="theme"
@select="handleMenuSelect"
/>
</template>

View File

@@ -42,12 +42,12 @@ onBeforeMount(() => {
<template>
<NormalMenu
:rounded="rounded"
:active-path="activePath"
:collapse="collapse"
:menus="menus"
:active-path="activePath"
:rounded="rounded"
:theme="theme"
@select="handleSelect"
@enter="(menu) => emit('enter', menu)"
@select="handleSelect"
/>
</template>

View File

@@ -21,12 +21,12 @@ const {
<template>
<TabsView
:active="currentActive"
:menus="createContextMenus"
:show-icon="showIcon"
:tabs="currentTabs"
:menus="createContextMenus"
:active="currentActive"
@update:active="handleClick"
@close="handleClose"
@un-push-pin="handleUnPushPin"
@update:active="handleClick"
/>
</template>

View File

@@ -75,15 +75,15 @@ function handleSelect(path: string) {
<VbenBreadcrumb
v-if="type === 'normal'"
:breadcrumbs="breadcrumbs"
class="ml-2"
:show-icon="showIcon"
class="ml-2"
@select="handleSelect"
/>
<VbenBackgroundBreadcrumb
v-if="type === 'background'"
:breadcrumbs="breadcrumbs"
class="ml-2"
:show-icon="showIcon"
class="ml-2"
@select="handleSelect"
/>
</template>

View File

@@ -70,8 +70,8 @@ function showSpinning(index: number) {
{{ iframeRoutes.length }}
<template v-for="(item, index) in iframeRoutes" :key="item.fullPath">
<div
v-show="routeShow(item)"
v-if="canRender(item)"
v-show="routeShow(item)"
class="relative size-full"
>
<Spinner :spinning="showSpinning(index)" />