mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-17 14:13:41 +08:00
feat(projects): add full screen watermark
This commit is contained in:
@@ -25,7 +25,9 @@ const props = withDefaults(defineProps<AdminLayoutProps>(), {
|
||||
siderCollapsedWidth: 64,
|
||||
footerVisible: true,
|
||||
footerHeight: 48,
|
||||
rightFooter: false
|
||||
rightFooter: false,
|
||||
watermarkVisible: true,
|
||||
watermarkText: 'SoybeanAdmin'
|
||||
});
|
||||
|
||||
interface Emits {
|
||||
@@ -48,6 +50,8 @@ type Slots = {
|
||||
sider?: SlotFn;
|
||||
/** Footer */
|
||||
footer?: SlotFn;
|
||||
/** Watermark */
|
||||
watermark?: SlotFn;
|
||||
};
|
||||
|
||||
const slots = defineSlots<Slots>();
|
||||
@@ -60,6 +64,7 @@ const showTab = computed(() => Boolean(slots.tab) && props.tabVisible);
|
||||
const showSider = computed(() => !props.isMobile && Boolean(slots.sider) && props.siderVisible);
|
||||
const showMobileSider = computed(() => props.isMobile && Boolean(slots.sider) && props.siderVisible);
|
||||
const showFooter = computed(() => Boolean(slots.footer) && props.footerVisible);
|
||||
const showWatermark = computed(() => Boolean(slots.watermark) && props.watermarkVisible);
|
||||
|
||||
// scroll mode
|
||||
const isWrapperScroll = computed(() => props.scrollMode === 'wrapper');
|
||||
@@ -230,6 +235,11 @@ function handleClickMask() {
|
||||
:class="[style['layout-footer-placement']]"
|
||||
></div>
|
||||
</template>
|
||||
|
||||
<!-- Watermark -->
|
||||
<template v-if="showWatermark">
|
||||
<slot name="watermark"></slot>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -132,6 +132,22 @@ export interface AdminLayoutFooterConfig {
|
||||
rightFooter?: boolean;
|
||||
}
|
||||
|
||||
/** Watermark config */
|
||||
export interface AdminLayoutWatermarkConfig {
|
||||
/**
|
||||
* Whether watermark is visible
|
||||
*
|
||||
* @default: true
|
||||
*/
|
||||
watermarkVisible?: boolean;
|
||||
/**
|
||||
* Watermark text
|
||||
*
|
||||
* @default: SoybeanAdmin
|
||||
*/
|
||||
watermarkText?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Layout mode
|
||||
*
|
||||
@@ -156,7 +172,8 @@ export interface AdminLayoutProps
|
||||
AdminLayoutTabConfig,
|
||||
AdminLayoutSiderConfig,
|
||||
AdminLayoutContentConfig,
|
||||
AdminLayoutFooterConfig {
|
||||
AdminLayoutFooterConfig,
|
||||
AdminLayoutWatermarkConfig {
|
||||
/**
|
||||
* Layout mode
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user