fix(vben): 修复组件适配器 attrs 透传
- 修复五端 DefaultButton/PrimaryButton 未展开 attrs 导致 confirm 按钮点击事件丢失 - 修复 web-ele Select、web-tdesign RangePicker 同类 attrs 误传问题 - 补充并通过定时任务执行确认弹窗 Playwright 自动化验证 - 已通过相关 adapter ESLint 与可用 typecheck 校验
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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', {
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user