this.currentMaxBatch++ let batch = '批次' + this.currentMaxBatch // 新增的列名 // 添加数据 this.productDataSource.forEach(item => { console.log('item=', item) this.$set(item, batch, '') // v-model可实时更新 // item[batch] = '' // v-model不能实时更新 }) // 添加列名 let columnsItem = { title: batch, 100, align: 'center', dataIndex: batch, scopedSlots: { customRender: batch }, } this.$nextTick(() => { this.productColumns.push(columnsItem) // 需要渲染列的集合,用于template渲染列 this.operation.push(batch) })