template
<div class="mui-table-view-cell mui-transitioning" v-for="(item,index) in goodsList" :key="index">
<div class="mui-slider-right mui-disabled">
<a class="mui-btn mui-btn-red mui-icon mui-icon-trash btn_delete" ref="item" @click="handleDelete(item, index)"></a>
</div>
<div class="mui-slider-handle">
12344566
</div>
</div>
方法
handleDelete (item, index) {
let self = this
var btnArray=['是','否'];
mui.confirm("Areyou sure?","Message",btnArray,function(){
self.goodsList = self.goodsList.filter((v, i) => {
return index !== i
})
self.$store.commit("updateAll", self.goodsList)
})
}
监听
goodsList: {
handler(){
let self = this
this.$store.commit("updateAll", this.goodsList);
self.$nextTick(() => {
document.querySelectorAll(".mui-btn")[0].style = ''
document.querySelectorAll(".mui-slider-handle")[0].style = ''
})
},
deep: true
}
网友评论