不管把function放在onload前面还是后面都报这个错误。后来发现是没有用that。
解决方案:
var that=this;
if(options.from=="one"){
//说明是从购物车来的,只买一件
that.data.list.push(that.getProductInfo(options.id));
}
不管把function放在onload前面还是后面都报这个错误。后来发现是没有用that。
解决方案:
var that=this;
if(options.from=="one"){
//说明是从购物车来的,只买一件
that.data.list.push(that.getProductInfo(options.id));
}