对于data中声明的一个数组变量arr=[],在绑定时候可以如下:
<div style="margin-top: 10px;margin-left: 40px;">
<span style="display: inline-block;width: 70px;"><el-checkbox v-model="checked[0]">MTS</el-checkbox></span><span style="display: inline-block;"><el-input size="medium" style="width: 360px;" v-model="input[0]"></el-input></span>
</div>
<div style="margin-top: 10px;margin-left: 40px;">
<span style="display: inline-block;width: 70px;"><el-checkbox v-model="checked[1]">SS</el-checkbox></span><span style="display: inline-block;"><el-input size="medium" style="width: 360px;" v-model="input[1]"></el-input></span>
</div>
<div style="margin-top: 10px;margin-left: 40px;">
<span style="display: inline-block;width: 70px;"><el-checkbox v-model="checked[2]">DMS</el-checkbox></span><span style="display: inline-block;"><el-input size="medium" style="width: 360px;" v-model="input[2]"></el-input></span>
</div>
数组中加index
效果图:
所有评论(0)