FormTable 表单表格
代码演示
基础用法
vue
<template>
<x-form-table v-model="formData.data">
<a-table-column title="名称">
<template #default="{ record }">
<a-input v-model:value="record.key"></a-input>
</template>
</a-table-column>
<a-table-column title="标识">
<template #default="{ record }">
<a-input v-model:value="record.key"></a-input>
</template>
</a-table-column>
</x-form-table>
</template>
<script setup>
import { useForm } from '@/hooks'
const { formData } = useForm()
formData.value = {
data: [],
}
</script>
<style lang="less" scoped></style>
API
Props
名称 | 说明 | 类型 | 默认值 |
---|---|---|---|
model-value(v-model) | 当前输入的值 | array | [] |
rowTpl | 行模板,用于插入行使用 | object | {} |
Events
名称 | 说明 | 返回值 |
---|---|---|
add | 添加数据 | - |
delete | 删除数据 | record |