toggleSelect方法,为啥子status和index变量不加var就有问题呢?index不加的话会提示为定义,然后商品取消选中后就选不回来了。status和index都加上var就一切正常。
toggleSelect: function (event) {
var id = cart.getDataSet(event, 'id');
status = cart.getDataSet(event, 'status');
index = this._getProductIndexById(id);
this.data.cartData[index].selectStatus = !status;
this._resetCartData();
},
登录后可查看更多问答,登录/注册