diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index f090cfe..e0bd489 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -707,6 +707,10 @@ export default { return true; }, onAddRow() { + if (this.$listeners && this.$listeners['onAddRow']) { + this.$emit('onAddRow'); + return; + } this.addRow({ actSolutionVolumePrecision: 3,//小数点精度默认为3 actSolutionConcentrationPrecision: 3,//小数点精度默认为3 @@ -714,10 +718,14 @@ export default { targetStartSolutionVolumePrecision: 3,//小数点精度默认为3 }); }, + // 添加行 addRow(row = {}) { this.localDataSource.push(row); }, + addRows(rows = []) { + this.localDataSource.push(...rows); + }, getDataSource() { return this.localDataSource; },