AB是两个tab页,切换的时候已经把addlist致为空数组了,js部分打印index值为啥是undefined?求解
<div class="tit">区域编号 A</div>
<div class="item" v-for="item in addList" :key="item.index" v-if="addList.length>0">
<el-input v-model="item.shelves_number" disabled></el-input>
<el-input v-model="item.shelves_layer" disabled></el-input>
<el-input v-model="item.shelves_layer_num" disabled></el-input>
<span>{{item.shelves_num}}</span>
<span><button @click="delBtn_2(item.index,addList)">删除</button></span>
</div>
<div class="tit">区域编号 B</div>
<div class="item" v-for="item in addList" :key="item.index" v-if="addList.length>0">
<el-input v-model="item.shelves_number" disabled></el-input>
<el-input v-model="item.shelves_layer" disabled></el-input>
<el-input v-model="item.shelves_layer_num" disabled></el-input>
<span>{{item.shelves_num}}</span>
<span><button @click="delBtn_2(item.index,addList)">删除</button></span>
</div>
js部分
delBtn_2(index,data){
console.log(index);
data.splice(index,1);
this.setList.splice(index,1);
吃鸡游戏
潇潇雨雨
相关分类