-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
I dunno how to define the v-bind on form item and rule
What does the proposed API look like?
within an edit table #bodyCell={record, index}
<template>
<a-form>
<a-table>
<template #bodyCell="{ column, index, record }">
<template v-if="column.key === 'name'">
<a-form-item v-bind="myFrom.validateInfos[`lists.${index}.role`]">
<a-input v-model:value="record.name" />
</a-form-item>
</template>
</template>
<a-table>
</a-form>
</template>
<script lang='ts' setup>
const myFrom = Form.useForm(
reactive({
lists: [{ name: undefined }]
}),
reactive({
'lists.index.name': [{ required: true, message: 'required' }]
})
)
</script>