WeChat Mini Programs wx:if judges whether there is data.

problem description

WeChat Mini Programs wx:if judges whether there is data

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

<view class="taskList" style="padding-top:{{paddingTop}}rpx;" wx:if="{{taskList}}">
</view>



what result do you expect? What is the error message actually seen?

I define an empty taskList array in js. Why does it also execute?

Apr.09,2021

<view class="taskList" style="padding-top:{{paddingTop}}rpx;" wx:if="{{taskList.length>0}}">
</view>

well, thank you for solving

Menu