fix: The attribute of option does not work
This commit is contained in:
parent
b320e658d1
commit
d946920e61
|
@ -29,8 +29,15 @@ export const useRenderSelect = (slots: Slots) => {
|
|||
// 如果有别名,就取别名
|
||||
const labelAlias = item?.componentProps?.optionsAlias?.labelField
|
||||
const valueAlias = item?.componentProps?.optionsAlias?.valueField
|
||||
|
||||
const { label, value, ...other } = option
|
||||
|
||||
return (
|
||||
<ElOption label={option[labelAlias || 'label']} value={option[valueAlias || 'value']}>
|
||||
<ElOption
|
||||
label={labelAlias ? option[labelAlias] : label}
|
||||
value={valueAlias ? option[valueAlias] : value}
|
||||
{...other}
|
||||
>
|
||||
{{
|
||||
default: () =>
|
||||
// option 插槽名规则,{field}-option
|
||||
|
|
|
@ -528,7 +528,8 @@ const schema = reactive<FormSchema[]>([
|
|||
options: [
|
||||
{
|
||||
label: 'option1-1',
|
||||
value: '1-1'
|
||||
value: '1-1',
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
label: 'option1-2',
|
||||
|
|
Loading…
Reference in New Issue