fix(form): select option 在没有adapter的时候默认使用el-option

This commit is contained in:
roymondchen 2024-04-25 19:38:43 +08:00
parent 9174e775ae
commit ad2146f3bd

View File

@ -23,24 +23,23 @@
<component <component
v-for="(group, index) in (options as SelectGroupOption[])" v-for="(group, index) in (options as SelectGroupOption[])"
:key="index" :key="index"
:is="optionGroupComponent?.component" :is="optionGroupComponent?.component || 'el-option-group'"
v-bind=" v-bind="optionGroupComponent?.props(group) || group"
optionGroupComponent?.props({
label: group.label,
disabled: group.disabled,
})
"
> >
<component <component
v-for="(item, index) in group.options" v-for="(item, index) in group.options"
:is="optionComponent?.component" :is="optionComponent?.component || 'el-option'"
:key="index" :key="index"
v-bind=" v-bind="
optionComponent?.props({ optionComponent?.props({
label: item.label || item.text, label: item.label || item.text,
value: item.value, value: item.value,
disabled: item.disabled, disabled: item.disabled,
}) }) || {
label: item.label || item.text,
value: item.value,
disabled: item.disabled,
}
" "
> >
</component> </component>
@ -51,14 +50,8 @@
v-for="option in (options as SelectOption[])" v-for="option in (options as SelectOption[])"
class="tmagic-design-option" class="tmagic-design-option"
:key="config.valueKey ? option.value[config.valueKey] : option.value" :key="config.valueKey ? option.value[config.valueKey] : option.value"
:is="optionComponent?.component" :is="optionComponent?.component || 'el-option'"
v-bind=" v-bind="optionComponent?.props(option) || option"
optionComponent?.props({
label: option.text,
value: option.value,
disabled: option.disabled,
})
"
> >
</component> </component>
</template> </template>