Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: title not shown when sidebar is not collapsed (#98)
Browse files Browse the repository at this point in the history
* fix: title not shown when sidebar is not collapsed

* update Logo type

* Update bridge.ts
  • Loading branch information
likui628 authored Sep 11, 2023
1 parent 953811b commit ab77d5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/hooks/src/config/useAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { useClipboard, _omit } from '@vben/utils'
export const useAppConfig = () => {
const useAppConfigStore = appConfigStore()
const appConfigOptions = storeToRefs(useAppConfigStore)
const { openSettingDrawer, sidebar, menu, isMixSidebar } = appConfigOptions
const { openSettingDrawer, sidebar, menu, isMixSidebar, isSidebar } =
appConfigOptions

const setAppConfig = (configs: DeepPartial<DefineAppConfigOptions>) => {
useAppConfigStore.$patch((state) => {
Expand Down Expand Up @@ -54,7 +55,7 @@ export const useAppConfig = () => {
useAppConfigStore.$reset()
}
const getCollapsedShowTitle = computed<boolean>(() => {
if (unref(isMixSidebar)) {
if (unref(isMixSidebar) || unref(isSidebar)) {
return !unref(sidebar).collapsed
}
return unref(menu).collapsedShowTitle && unref(sidebar).collapsed
Expand Down
7 changes: 5 additions & 2 deletions packages/layouts/bridge.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { VNode } from 'vue'
import { DefineComponent } from 'vue'
import { RouteLocationNormalized } from 'vue-router'
import {
useRootSetting,
Expand All @@ -11,6 +11,9 @@ import {
useAppConfig,
} from '@vben/hooks'

type LogoComponent = DefineComponent<{
showTitle?: boolean
}>
export interface ContextOptions {
useAppConfig: typeof useAppConfig
useRootSetting: typeof useRootSetting
Expand Down Expand Up @@ -38,7 +41,7 @@ export interface ContextOptions {
getChildrenMenus: (parentPath: string) => Promise<any>
getAllParentPath: (menu, path) => string[]
siteSetting: Record<string, string>
Logo: VNode | null
Logo: Nullable<LogoComponent>
}

export let context: ContextOptions = {
Expand Down

0 comments on commit ab77d5e

Please sign in to comment.