From 1cab0e4e81ac5f701aa7d140109f623882996c1d Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 4 Jul 2026 22:03:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(vben):=20=E4=BF=AE=E5=A4=8D=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=80=82=E9=85=8D=E5=99=A8=20attrs=20=E9=80=8F?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复五端 DefaultButton/PrimaryButton 未展开 attrs 导致 confirm 按钮点击事件丢失 - 修复 web-ele Select、web-tdesign RangePicker 同类 attrs 误传问题 - 补充并通过定时任务执行确认弹窗 Playwright 自动化验证 - 已通过相关 adapter ESLint 与可用 typecheck 校验 --- apps/web-antd/src/adapter/component/index.ts | 4 ++-- apps/web-antdv-next/src/adapter/component/index.ts | 4 ++-- apps/web-ele/src/adapter/component/index.ts | 6 +++--- apps/web-naive/src/adapter/component/index.ts | 4 ++-- apps/web-tdesign/src/adapter/component/index.ts | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/web-antd/src/adapter/component/index.ts b/apps/web-antd/src/adapter/component/index.ts index 36ac97f92..9aa3c0043 100644 --- a/apps/web-antd/src/adapter/component/index.ts +++ b/apps/web-antd/src/adapter/component/index.ts @@ -702,7 +702,7 @@ async function initComponentAdapter() { DatePicker, // 自定义默认按钮 DefaultButton: (props, { attrs, slots }) => { - return h(Button, { ...props, attrs, type: 'default' }, slots); + return h(Button, { ...props, ...attrs, type: 'default' }, slots); }, Divider, IconPicker: withDefaultPlaceholder(IconPicker, 'select', { @@ -718,7 +718,7 @@ async function initComponentAdapter() { Mentions: withDefaultPlaceholder(Mentions, 'input'), // 自定义主要按钮 PrimaryButton: (props, { attrs, slots }) => { - return h(Button, { ...props, attrs, type: 'primary' }, slots); + return h(Button, { ...props, ...attrs, type: 'primary' }, slots); }, Radio, RadioGroup, diff --git a/apps/web-antdv-next/src/adapter/component/index.ts b/apps/web-antdv-next/src/adapter/component/index.ts index 74f89517d..721a93e7d 100644 --- a/apps/web-antdv-next/src/adapter/component/index.ts +++ b/apps/web-antdv-next/src/adapter/component/index.ts @@ -716,7 +716,7 @@ async function initComponentAdapter() { DatePicker, // 自定义默认按钮 DefaultButton: (props, { attrs, slots }) => { - return h(Button, { ...props, attrs, type: 'default' }, slots); + return h(Button, { ...props, ...attrs, type: 'default' }, slots); }, Divider, IconPicker: withDefaultPlaceholder(IconPicker, 'select', { @@ -732,7 +732,7 @@ async function initComponentAdapter() { Mentions: withDefaultPlaceholder(Mentions, 'input'), // 自定义主要按钮 PrimaryButton: (props, { attrs, slots }) => { - return h(Button, { ...props, attrs, type: 'primary' }, slots); + return h(Button, { ...props, ...attrs, type: 'primary' }, slots); }, Radio, RadioGroup, diff --git a/apps/web-ele/src/adapter/component/index.ts b/apps/web-ele/src/adapter/component/index.ts index 34fea138d..dca63d02e 100644 --- a/apps/web-ele/src/adapter/component/index.ts +++ b/apps/web-ele/src/adapter/component/index.ts @@ -319,11 +319,11 @@ async function initComponentAdapter() { // 自定义默认按钮 DefaultButton: (props, { attrs, slots }) => { // 调整 type 为 default ,info 有点丑 - return h(ElButton, { ...props, attrs, type: 'default' }, slots); + return h(ElButton, { ...props, ...attrs, type: 'default' }, slots); }, // 自定义主要按钮 PrimaryButton: (props, { attrs, slots }) => { - return h(ElButton, { ...props, attrs, type: 'primary' }, slots); + return h(ElButton, { ...props, ...attrs, type: 'primary' }, slots); }, Divider: ElDivider, IconPicker: withDefaultPlaceholder(IconPicker, 'select', { @@ -356,7 +356,7 @@ async function initComponentAdapter() { ); }, Select: (props, { attrs, slots }) => { - return h(ElSelectV2, { ...props, attrs }, slots); + return h(ElSelectV2, { ...props, ...attrs }, slots); }, Space: ElSpace, Switch: ElSwitch, diff --git a/apps/web-naive/src/adapter/component/index.ts b/apps/web-naive/src/adapter/component/index.ts index f6769f25f..d1c8a0771 100644 --- a/apps/web-naive/src/adapter/component/index.ts +++ b/apps/web-naive/src/adapter/component/index.ts @@ -221,11 +221,11 @@ async function initComponentAdapter() { DatePicker: NDatePicker, // 自定义默认按钮 DefaultButton: (props, { attrs, slots }) => { - return h(NButton, { ...props, attrs, type: 'default' }, slots); + return h(NButton, { ...props, ...attrs, type: 'default' }, slots); }, // 自定义主要按钮 PrimaryButton: (props, { attrs, slots }) => { - return h(NButton, { ...props, attrs, type: 'primary' }, slots); + return h(NButton, { ...props, ...attrs, type: 'primary' }, slots); }, Divider: NDivider, IconPicker: withDefaultPlaceholder(IconPicker, 'select', { diff --git a/apps/web-tdesign/src/adapter/component/index.ts b/apps/web-tdesign/src/adapter/component/index.ts index 37a3055e7..02bb7dd34 100644 --- a/apps/web-tdesign/src/adapter/component/index.ts +++ b/apps/web-tdesign/src/adapter/component/index.ts @@ -228,7 +228,7 @@ async function initComponentAdapter() { } return h( Button, - { ...props, ghost, variant, attrs, theme: 'default' }, + { ...props, ...attrs, ghost, variant, theme: 'default' }, slots, ); }, @@ -254,7 +254,7 @@ async function initComponentAdapter() { } return h( Button, - { ...props, ghost, variant, attrs, theme: 'primary' }, + { ...props, ...attrs, ghost, variant, theme: 'primary' }, slots, ); }, @@ -263,7 +263,7 @@ async function initComponentAdapter() { RangePicker: (props, { attrs, slots }) => { return h( RangePicker, - { ...props, modelValue: props.modelValue ?? [], attrs }, + { ...props, ...attrs, modelValue: props.modelValue ?? [] }, slots, ); },