XiaokangLei / ColorUI-GA

✨✨基于ColorUI 2.0开发的小程序css组件库。更多样式+免费UI模板🚀🚀
https://xiaokanglei.github.io/ColorUI-GA-Docs/
321 stars 39 forks source link

for循环下的条件渲染,piano渲染效果异常 #13

Open digcore opened 1 year ago

digcore commented 1 year ago
<view class="cu-list margin-top menu" wx:for="{{foundDevices}}" wx:key="item">
    <!-- 渲染设备列表 -->
    <!-- wx:if="{{item.showDevice}}"  -->
    <block wx:if="{{item.showDevice}}">
        <view class="cu-item margin-left-sm margin-right-sm radius-xl" bindtap="click" data-index="{{ index }}">
            <view class="content padding-tb-sm text-shadow">
                <view class="text-xl text-blue">{{(item.name)?item.name:'N/A'}}</view>
                <view class="flex justify-start text-sm">
                    <text class="bg-blue light cuIcon-link">{{item.deviceId}}</text>
                    <view></view>
                    <text class="bg-green light cuIcon-wifi">{{item.RSSI}}</text>
                </view>
            </view>
            <button class="cu-btn round lines-{{item.connectable ? 'blue' : 'gray'}} shadow disable" style="width: 150rpx;" catchtap="onConnect" data-index="{{ index }}">连接</button>
            <view class="action padding-left-xs">
                <text class="cuIcon-{{item['checked'] ? 'unfold' : 'right'}}"></text>
            </view>
        </view>
        <view class="cu-item {{item['checked'] ? '' : 'piano-hidden-content'}}" wx:for="{{item.advertisData}}" wx:for-item="child" wx:key="item">
            <view class="content">
                <text>{{ child }}</text>
            </view>
        </view>
    </block>
</view>

微信图片_20230221154353