遇见问题记录起来,方便以后隔了很久再次遇到。
elment ui 中el-input标签中@input初始化赋值时会触发到@input方法
javascript
<el-input-number
v-model="scope.row.discount_value"
:controls="false"
:min="0"
:precision="0"
@input="setDiscount_value(scope.row, scope.$index)"
size="mini"
:max="productDiscount.activity_type === 'DIRECT_DISCOUNT' ? 100 : Infinity"></el-input-number>
把@input方法 改成 @change
javascript
<el-input-number
v-model="scope.row.discount_value"
:controls="false"
:min="0"
:precision="0"
@change="setDiscount_value(scope.row, scope.$index)"
size="mini"
:max="productDiscount.activity_type === 'DIRECT_DISCOUNT' ? 100 : Infinity"></el-input-number>