vue实现购物车功能(商品分类)
本文实例为大家分享了vue实现购物车功能的具体代码,供大家参考,具体内容如下
newVue({ el:"#app", data:{ cIndex:0, lists:[ { title:"推荐商品", goods:[ { id:0, img:'./images/goods.png', name:'散称樱桃1', price:'10.00', num:0 }, { id:1, img:'./images/goods.png', name:'散称樱桃1', price:'10.00', num:0 } ] }, { title:"推荐商品", goods:[ { id:2, img:'./images/goods.png', name:'散称樱桃2', price:'20.00', num:0 }, { id:3, img:'./images/goods.png', name:'散称樱桃2', price:'20.00', num:0 }, ] }, ], carArr:[], appearCar:false, }, computed:{ alltotal:function(){ varalltotal=0; varallNum=0; for(vari=0,len=this.lists.length;ihtml页面
扫码