看到有人说直接在li里的v-for这样写v-for=“(item,index) in productList”,删除方法就可以delProduct:function(index){
this.productList.splice(index,1);
this.delFlag = false;
}
测试出来 如果点击全选按钮 然后删除其中任何一个商品,都是默认删除的第一个商品,感觉还是要按照老师的方法来获取索引
this.productList.splice(index,1);
this.delFlag = false;
}
测试出来 如果点击全选按钮 然后删除其中任何一个商品,都是默认删除的第一个商品,感觉还是要按照老师的方法来获取索引
2018-01-24
单选全部选择触发全选:var arr=[],
_this=this;
this.productList.forEach(function(item,index){
if (item.checked) {
arr.push(index);
}
})
if (arr.length==this.productList.length) {
this.checkFig(true);
}else{
this.checkAll=false;
}
_this=this;
this.productList.forEach(function(item,index){
if (item.checked) {
arr.push(index);
}
})
if (arr.length==this.productList.length) {
this.checkFig(true);
}else{
this.checkAll=false;
}
2018-01-18
this.ShopCart.forEach(function(item, index) {
if(item.checked) {
_this.checkAllFlog = true;
} else {
_this.checkAllFlog = false;
}
})
这段代码貌似有BUG,点击最后一个单选会触发多选
if(item.checked) {
_this.checkAllFlog = true;
} else {
_this.checkAllFlog = false;
}
})
这段代码貌似有BUG,点击最后一个单选会触发多选
2018-01-18
做了一些总结与分析,里面有未开发的源码和已经完成的代码,求围观,求建议。地址:https://github.com/CruxF/Vue-base
2018-01-16