1. 效果图
2. 代码
// html部分
<div>
<span class="current-row">{{form.currentRow}}</span>
<a-button size="small" @click="delRow">
<a-icon type="left" />
</a-button>
<a-button size="small" @click="addRow">
<a-icon type="right" />
</a-button>
</div>
// js部分
addRow() {
return this.form.currentRow++
},
delRow() {
return this.form.currentRow === 0 ? 0 : this.form.currentRow--
}
// css部分
.current-row {
display: inline-block;
width: 50px;
}