wechat-miniprogram / recycle-view

recycle-view: a wechat miniprogram custom component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

报错误 Cannot read property 'height' of null

jk2K opened this issue · comments

image

image

解决, 不能使用 wx:if, recycle-view 必须一直存在,如果想实现显隐效果,应该用 hidden

错误

<view wx:if="{{isLoading}}">
  <mp-loading type="circle"></mp-loading>
</view>
<view wx:else class="info-list weui-cells">
  <recycle-view batch="{{batchSetRecycleData}}" id="recycleId" enable-back-to-top="true">
    <view slot="before"></view>
    <recycle-item wx:for="{{recycleList}}" wx:key="id">
    </recycle-item>
    <view slot="after">到底部了,不要再拉了</view>
  </recycle-view>
</view>

正确

<view hidden="{{!isLoading}}">
    <mp-loading type="circle"></mp-loading>
</view>
<view hidden="{{isLoading}}" class="info-list weui-cells">
  <recycle-view batch="{{batchSetRecycleData}}" id="recycleId" enable-back-to-top="true">
    <view slot="before"></view>
    <recycle-item wx:for="{{recycleList}}" wx:key="id">
    </recycle-item>
    <view slot="after">到底部了,不要再拉了</view>
  </recycle-view>
</view>
commented

@jk2K
这个问题是只出现在Android吗?