小程序判断 复选框当前操作是加项还是减项方法
wxml: <checkbox-group bindchange="getChecked"> <view class="lp_item" wx:for="{{xinfang}}" wx:key="item" wx:for-index="index"> <checkbox value='{{item.aid}}' checked='{{item.selected}}'> <text class="cTit">{{item.title}}</text> </checkbox> </view> </checkbox-group> js: getChecked: function(e){ console.log(e.detail.value.length>0?'+':'-'); }