Skip to content

FormTable 表单表格

代码演示

基础用法

vue
<script setup>
import { useForm } from '@/hooks'

const { formData } = useForm()

formData.value = {
  data: [],
}
</script>

<template>
  <x-form-table v-model="formData.data">
    <a-table-column title="名称">
      <template #default="{ record }">
        <a-input v-model:value="record.key" />
      </template>
    </a-table-column>
    <a-table-column title="标识">
      <template #default="{ record }">
        <a-input v-model:value="record.key" />
      </template>
    </a-table-column>
  </x-form-table>
</template>

<style lang="less" scoped></style>

API

Props

名称说明类型默认值
model-value(v-model)当前输入的值array[]
rowTpl行模板,用于插入行使用object{}

Events

名称说明返回值
add添加数据-
delete删除数据record

本文档内容版权为 XYAdmin 作者所有,保留所有权利。