ant-design vue 实现增行减行

增行方法:handleAddColumn()
删行方法:handleDeleteColumn(selectedRows)

<template>
  <a-card :bordered="false">
    <a-form @submit="handleSubmit" :form="form">
      <a-tabs @change="callback" defaultActiveKey="2" type="card">
        <a-tab-pane tab="基本信息" key="1">
          <basic-info-form ref="basicinfo" :showSubmit="false" :info="info" />
        </a-tab-pane>
        <a-tab-pane tab="字段信息" key="2">
          <a-button icon="plus" type="primary" @click="handleAddColumn">增行</a-button>
          <a-button icon="minus" type="danger" @click="handleDeleteColumn(selectedRows)">删行</a-button>

          <a-table
            :pagination="false"
            :columns="columns"
            :dataSource="data"
            rowKey="columnId"
            :row-selection="rowSelection"
            rowClassName="rowClassName"
          >
            <span slot="serial" slot-scope="text, record, index">{
   {
    index + 1 }}</span>
            <template slot="PhysicalType" slot-scope="text, record">
              <a-select
                :value="text"
                style="width: 120px"
                @change="e => handleChange(e, record.columnId, 'PhysicalType')"
              >
                <a-select-option
                  :value="item.key"
                  v-for="item in javaType"
                  :key="item.key"
                >{
   {
    item.label }}</a-select-option>
                <!-- :options="javaType" -->
                <!-- <a-select-option value="Long">bigint(20)</a-select-option>
                <a-select-option value="String">String</a-select-option>
                <a-select-option value="Ingeter">Ingeter</a-select-option>
                <a-select-option value="Double">Double</a-select-option>
                <a-select-option value="BigDecimal">BigDecimal</a-select-option>
                <a-select-option value="Date">Date</a-select-option>-->
              </a-select>
            </template>
            <template slot="type" slot-scope="text, record">
              <a-select
                :value="text"
                style="width: 120px"
                @change="e => handleChange(e, record.columnId, 'type')"
              >
                <a-select-option
                  :value="item.key"
                  v-for="item in javaType"
                  :key="item.key"
                >{
   {
    item.label }}</a-select-option>
                <!-- <a-select-option value="String">String</a-select-option>
                <a-select-option value="Ingeter">Ingeter</a-select-option>
                <a-select-option value="Double">Double</a-select-option>
                <a-select-option value="BigD
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值