From 2cc918f79df716cb98f5a0b4ab2274260f3c9702 Mon Sep 17 00:00:00 2001 From: Arthur Darkstone Date: Wed, 11 Dec 2024 09:57:45 +0800 Subject: [PATCH] feat: replace `ElSelect` with `ElSelectV2` in component adapter for butter performance (#5085) --- apps/web-ele/src/adapter/component/index.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/apps/web-ele/src/adapter/component/index.ts b/apps/web-ele/src/adapter/component/index.ts index 118253d8c..6c8667cd5 100644 --- a/apps/web-ele/src/adapter/component/index.ts +++ b/apps/web-ele/src/adapter/component/index.ts @@ -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,