for循环处突然报出这种错,有些安卓数据还不能显示
发布于 6 年前 作者 yong04 8454 次浏览 来自 问答

for developer:Do not set same key {true} in wx:key,

<!-- 分类 -->

<view class=“layout cate”>

<view class=“title_left message-category”>

<!–cate-active  选中  -->

<scroll-view class=“flex” scroll-x=“false” scroll-with-animation=“true”>

<view class=“category {{labelType==index? ‘cate-active’ : ‘’}}” wx:for="{{hotStar}}" wx:key=“hotStar” data-labelid="{{index}}" bindtap=“tabFun”>{{item.itemName}}</view>

</scroll-view>

</view>

<view class=“scroll-view {{labelType==index? ‘show-active’ : ‘hide-active’}}” wx:for="{{hotStar}}" wx:key=“hotStar” wx:for-item=“hotStar”>

<scroll-view class=“scroll-view_H” scroll-x=“true” scroll-with-animation=“true” scroll-into-view="{{toView}}" scroll-left="{{scrollTop}}">

<!-- 滚动第一个view -->

<view class=“scroll-view-item_H” wx:for="{{hotStar.dtos}}" wx:key=“hotStarVOs” data-id="{{item.starId}}">

<!-- 弹授权  -->

<button open-type=“getUserInfo” bindgetuserinfo=“getUserInfo” class=“scroll-view-item_H_C left” data-id="{{item.starId}}" data-status=“热门人物” data-id="{{item.starId}}" plain>

<view class=‘img’>

<image lazy-load=“true” wx:if="{{item.avatar != ‘’}}" src="{{item.avatar}}"></image>

<image lazy-load=“true” wx:else src="{{imageUrl}}/images/index/[email protected]"></image>

</view>

<view class=‘info flex’>

<view class=‘product flex’>

<view class=“title {{item.productVOs.length == ‘’?‘active’:’’}}”>{{item.peopleName}}</view>

<text class=‘line’ wx:if="{{item.productVOs.length != ‘’}}">|</text>

<view class=‘product-name’>{{item.productVOs[0].productName}}</view>

</view>

<view class=‘people’>

<text>{{item.hotTitle==null?’-’:item.hotTitle}}</text>

</view>

</view>

</button>

</view>

</scroll-view>

</view>

</view>

1 回复

你好,请检查一下列表中的key值是否有重复

回到顶部