perf: optimize local startup speed and add header Class configuration to drawer (#4840)

This commit is contained in:
Vben
2024-11-09 11:12:30 +08:00
committed by GitHub
parent da7d61b160
commit 9cf0573921
7 changed files with 321 additions and 312 deletions

View File

@@ -7,7 +7,7 @@ export interface DrawerProps {
* 取消按钮文字
*/
cancelText?: string;
class?: string;
class?: any;
/**
* 是否显示右上角的关闭按钮
* @default true
@@ -42,6 +42,14 @@ export interface DrawerProps {
* @default true
*/
footer?: boolean;
/**
* 弹窗底部样式
*/
footerClass?: any;
/**
* 弹窗头部样式
*/
headerClass?: any;
/**
* 弹窗是否显示
* @default false

View File

@@ -56,6 +56,8 @@ const {
contentClass,
description,
footer: showFooter,
footerClass,
headerClass,
loading: showLoading,
modal,
openAutoFocus,
@@ -130,9 +132,13 @@ function handleFocusOutside(e: Event) {
>
<SheetHeader
:class="
cn('!flex flex-row items-center justify-between border-b px-6 py-5', {
'px-4 py-3': closable,
})
cn(
'!flex flex-row items-center justify-between border-b px-6 py-5',
headerClass,
{
'px-4 py-3': closable,
},
)
"
>
<div>
@@ -186,7 +192,12 @@ function handleFocusOutside(e: Event) {
<SheetFooter
v-if="showFooter"
class="w-full flex-row items-center justify-end border-t p-2 px-3"
:class="
cn(
'w-full flex-row items-center justify-end border-t p-2 px-3',
footerClass,
)
"
>
<slot name="prepend-footer"></slot>
<slot name="footer">