请教下,在微信小程序中wxml中有以下代码:
< block wx:for = "{{answer_arr}}" > < view class = "tr" > < block wx:for = "{{keyword_arr}}" > < view wx:if = "{{item.key_flag}}" style = "color:#FF00FF" >{{item.alphabet}}</ view > < view wx:else>{{item.alphabet}}</ view > </ block > <!-- <view class='td'>{{item.answer_word}}</view> --> < view class = 'td' >{{item.cor_num}}</ view > </ view > </ block > |
只使用this.setData({answer_arr: this.data.answer_arr});为何keyword_arr没有更新?
请问如何才能让answer_arr和keyword_arr的UI都更新?
<block wx:for="{{answer_arr}}" wx:for-item="top">
<view class="tr">
<block wx:for="{{keyword_arr}}">
<view wx:if="{{item.key_flag}}" style="color:#FF00FF">{{item.alphabet}}</view>
<view wx:else>{{item.alphabet}}</view>
</block>
<!-- <view class='td'>{{top.answer_word}}</view> -->
<view class='td'>{{top.cor_num}}</view>
</view>
</block>
我猜不到,你写个代码片段可好:
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
来个完整代码