使⽤v-for添加多个input框
<el-form-item v-if="rulePowerForm.freightMode==2">
<div v-for="(item,index) in rulePowerForm.logisticsIncrement" :key="index" >
<el-form-item required>
<el-col :span="10">
<el-form-item label="下单满" prop="satisfyOrder">
input框禁止输入<el-input type="text" v-model.number="rulePowerForm.logisticsIncrement[index].satisfyOrder" placeholder="输⼊数字"
oninput="place(/[^\d]/g,'')"></el-input>
<span>元,减免</span>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item prop="reductionMoney">
<el-input type="text" v-model.number="rulePowerForm.logisticsIncrement[index].reductionMoney" placeholder="输⼊数字" oninput="place(/[^\d]/g,'')"></el-input>
<span>元运费</span>
</el-form-item>
</el-col>
<el-button :size="size" type="primary" @click="addOrderGivenStairArr(index)" v-show="index==0" >添加</el-button>
<el-button :size="size" type="danger" @click="deelteOrderGivenStairArr(index)" v-show="index != 0">删除</el-button>
</el-form-item>
</div>
</el-form-item>
// 新增物流权益
addOrderGivenStairArr() {
if(this.rulePowerForm.logisticsIncrement.length>9){
this.$message({ message: "新增最多不超过⼗条!", type: "error" });
}
this.rulePowerForm.logisticsIncrement.push({})
},
deelteOrderGivenStairArr(index) {
this.rulePowerForm.logisticsIncrement.splice(index,1)
},
rulePowerForm: {
logisticsIncrement: [{satisfyOrder:"",reductionMoney:""}],
},
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论