Commit 2cc918f7 by Arthur Darkstone Committed by GitHub

feat: replace `ElSelect` with `ElSelectV2` in component adapter for butter performance (#5085)

1 parent 07b1ad12
......@@ -22,11 +22,9 @@ import {
ElInput,
ElInputNumber,
ElNotification,
ElOption,
ElRadio,
ElRadioButton,
ElRadioGroup,
ElSelect,
ElSelectV2,
ElSpace,
ElSwitch,
......@@ -165,21 +163,7 @@ async function initComponentAdapter() {
);
},
Select: (props, { attrs, slots }) => {
let defaultSlot;
if (Reflect.has(slots, 'default')) {
defaultSlot = slots.default;
} else {
const { options } = attrs;
if (Array.isArray(options)) {
defaultSlot = () => options.map((option) => h(ElOption, option));
}
}
const placeholder = props?.placeholder || $t(`ui.placeholder.select`);
return h(
ElSelect,
{ ...props, ...attrs, placeholder },
{ ...slots, default: defaultSlot },
);
return h(ElSelectV2, { ...props, attrs }, slots);
},
Space: ElSpace,
Switch: ElSwitch,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!