wip: Form改造中

This commit is contained in:
kailong321200875
2023-04-28 14:02:27 +08:00
parent 1d0f4b4c39
commit 2261f49976
6 changed files with 517 additions and 88 deletions

View File

@@ -499,49 +499,65 @@ const schema = reactive<FormSchema[]>([
controlsPosition: 'right'
},
value: 10
},
{
field: 'field13',
label: t('formDemo.select'),
component: 'Divider'
},
{
field: 'field14',
label: t('formDemo.default'),
component: 'Select',
componentProps: {
optionDisabled: (item: any, data: any) => {
console.log(item, data)
return false
},
options: [
{
disabled: true,
label: 'option1',
value: '1'
},
{
label: 'option2',
value: '2'
}
]
}
},
{
field: 'field15',
label: t('formDemo.slot'),
component: 'Select',
componentProps: {
options: [
{
label: 'option1',
value: '1'
},
{
label: 'option2',
value: '2'
}
],
slots: {
default: (item) => {
console.log(item)
return (
<>
<span style="float: left">{item.label}</span>
<span style=" float: right; color: var(--el-text-color-secondary); font-size: 13px;">
{item.value}
</span>
</>
)
}
}
}
}
// {
// field: 'field13',
// label: t('formDemo.select'),
// component: 'Divider'
// },
// {
// field: 'field14',
// label: t('formDemo.default'),
// component: 'Select',
// componentProps: {
// options: [
// {
// disabled: true,
// label: 'option1',
// value: '1'
// },
// {
// label: 'option2',
// value: '2'
// }
// ]
// }
// },
// {
// field: 'field15',
// label: t('formDemo.slot'),
// component: 'Select',
// componentProps: {
// options: [
// {
// label: 'option1',
// value: '1'
// },
// {
// label: 'option2',
// value: '2'
// }
// ],
// optionsSlot: true
// }
// },
// {
// field: 'field16',
// label: t('formDemo.selectGroup'),
// component: 'Select',