Bad attr `animation` with message
> 1 | <view class="menuPage"><view class="top"><block wx:for="{{aMeua}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="yMenu" animation="{{index==sDeleteselect?animationData1:{}}}" id="{{index==sDeleteselect?'yselect':'no'}}" data-event-opts="{{[['tap',[['animationDelete',['$0',index],[[['aMeua','',index,'id']]]]]]]}}" bindtap="__e"><view class="yMenuitem"><image src="{{item.image}}"></image><text>{{item.title}}</text></view><view class="icon"><block wx:if="{{item.title}}"><image src="../../static/menu/delete.png"></image></block></view></view></block></view><view class="buttom"><block wx:for="{{aMeua1}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="yAllmenu" animation="{{index==sSelect?animationData:{}}}" id="{{index==sSelect?'select':'no'}}" data-event-opts="{{[['tap',[['fanimation',['$0',index],[[['aMeua1','',index,'id']]]]]]]}}" bindtap="__e"><view class="yMenuitem"><image src="{{item.image}}"></image><text>{{item.title}}</text></view><view class="icon"><image src="../../static/menu/add.png"></image></view></view></block></view></view>
|
animation="{{index==sDeleteselect?animationData1:''}}" {}换成单引号就不报错了
错误信息:
[ WXML 文件编译错误] ./pages/my/my.wxml
Bad attr `data-event-params` with message
51 | <text class="getNum data-v-a437daa2">{{'+ '+item.number}}</text>
52 | <text class="taskName data-v-a437daa2">{{item.type_name}}</text>
> 53 | <view bindtap="__e" class="{{['clickBtn data-v-a437daa2',item.status==1?'clickBtnGray':'']}}" data-event-opts="{{[ [ 'tap',[ [ 'e0',['$event'] ] ] ] ]}}" data-event-params="{{item:item}}">
| ^
54 | <text class="data-v-a437daa2" wx:if="{{item.status==1}}">已完成</text>
55 | <block wx:else>
56 | <text class="data-v-a437daa2" wx:if="{{item.type==2}}">去完成</text>
at files://pages/my/my.wxml#53(env: Windows,mp,1.05.2105170; lib: 2.17.0)
======================
原代码:
<view class="voucherTask data-v-a437daa2" wx:if="{{couponTaskList.length}}">
<view class="taskTitle data-v-a437daa2">每日阅读券任务</view>
<view class="taskItem data-v-a437daa2" wx:for="{{couponTaskList}}" wx:key="index">
<image mode class="voucherImage data-v-a437daa2" src="{{item.icon}}"></image>
<text class="getNum data-v-a437daa2">{{'+ '+item.number}}</text>
<text class="taskName data-v-a437daa2">{{item.type_name}}</text>
<view bindtap="__e" class="{{['clickBtn data-v-a437daa2',item.status==1?'clickBtnGray':'']}}" data-event-opts="{{[ [ 'tap',[ [ 'e0',['$event'] ] ] ] ]}}" data-event-params="{{item:item}}">
<text class="data-v-a437daa2" wx:if="{{item.status==1}}">已完成</text>
<block wx:else>
<text class="data-v-a437daa2" wx:if="{{item.type==2}}">去完成</text>
<text class="data-v-a437daa2" wx:else>领取</text>
</block>
</view>
</view>
</view>
解决办法
" data-event-params="{{['item:item']}}"