ant design vue 中合并表格后用v-model 绑定data中数据

在这里插入图片描述

<a-table :columns="prepaycolumns" :data-source="prepaydata" :pagination="false" >
  <template slot="footer">
     <span>应付总金额:¥24000.00</span>
   </template>
 </a-table>
data() {
    const prepaycolumns = [
      { dataIndex: 'id', title: '商品编码', align: 'center', width: 120 },
      { dataIndex: 'name', title: '商品名称', align: 'center', width: 300 },
      { dataIndex: 'type', title: '规格型号', align: 'center', width: 120 },
      { dataIndex: 'price', title: '商品单价', align: 'center', width: 120 },
      { dataIndex: 'payNum', title: '应收数量', align: 'center', width: 120 },
      { dataIndex: 'payPrice', title: '应付金额', align: 'center', width: 120 },
      {
        dataIndex: 'prepayPrice',
        title: '预付款金额',
        scopedSlots: { customRender: 'prepayPrice' },
        align: 'center',
        customRender: (value, row, index) => {
          const obj = {
            children: <a-input v-model={this.submitData.price}></a-input>, //绑定数据
            attrs: {},
          };
          if (index === 0) {
            obj.attrs.rowSpan = 2;
          }
          if (index === 1) {
            obj.attrs.rowSpan = 0;
          }
          return obj;
        },
      },
      {
        dataIndex: 'remark',
        title: '备注',
        scopedSlots: { customRender: 'remark' },
        align: 'center',
        customRender: (value, row, index) => {
          console.log(value);
          const obj = {
            children: <a-input v-model={this.submitData.remark}></a-input>, //绑定数据
            attrs: {},
          };
          if (index === 0) {
            obj.attrs.rowSpan = 2;
          }
          if (index === 1) {
            obj.attrs.rowSpan = 0;
          }
          return obj;
        },
      },
    ]
    return {
      prepaycolumns,
      prepaydata,
      submitData:{}
    }
  },

在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值