// components/cart/cart.js Component({ /** * 组件的属性列表 */ properties: { cartFlag:Boolean, list:Array, color:String }, /** * 组件的初始数据 */ data: { }, options: { addGlobalClass: true, }, /** * 组件的方法列表 */ methods: { cy_hide:function(){ this.triggerEvent("cy_hide"); }, cy_clearCart:function(){ this.triggerEvent("cy_clearCart"); }, cy_subCartItem:function(e){ this.triggerEvent("cy_subCartItem",e.currentTarget); }, cy_addCartItem:function(e){ this.triggerEvent("cy_addCartItem",e.currentTarget); }, cy_subSpecItem:function(){ this.triggerEvent("cy_subSpecItem"); }, cy_addSpecItem:function(){ this.triggerEvent("cy_addSpecItem"); } } })