-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
260 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import type { LayoutType } from '@vben-core/typings'; | ||
|
||
import type { VbenLayoutProps } from '../vben-layout'; | ||
|
||
import { computed } from 'vue'; | ||
|
||
export function useLayout(props: VbenLayoutProps) { | ||
const currentLayout = computed(() => | ||
props.isMobile ? 'sidebar-nav' : (props.layout as LayoutType), | ||
); | ||
|
||
/** | ||
* 是否全屏显示content,不需要侧边、底部、顶部、tab区域 | ||
*/ | ||
const isFullContent = computed(() => currentLayout.value === 'full-content'); | ||
|
||
/** | ||
* 是否侧边混合模式 | ||
*/ | ||
const isSidebarMixedNav = computed( | ||
() => currentLayout.value === 'sidebar-mixed-nav', | ||
); | ||
|
||
/** | ||
* 是否为头部导航模式 | ||
*/ | ||
const isHeaderNav = computed(() => currentLayout.value === 'header-nav'); | ||
|
||
/** | ||
* 是否为混合导航模式 | ||
*/ | ||
const isMixedNav = computed(() => currentLayout.value === 'mixed-nav'); | ||
|
||
return { | ||
currentLayout, | ||
isFullContent, | ||
isHeaderNav, | ||
isMixedNav, | ||
isSidebarMixedNav, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.