cover-view 真机无法显示
发布于 6 年前 作者 haojun 10134 次浏览 来自 问答

您好,升级了新版小程序后发现推出了cover-view组件,我们正好之前有个悬浮按钮会受canvas影响,就试了一下,但发现模拟器上正常,但真机无法显示。

代码如下:

  <cover-view wx:if="{{canUseCoverView}}" class=“float-share”>

    <button id=“share-btn” open-type=“share” plain=“true”>

      <image class=“share-img” src="/images/share_btn.png"></image>

    </button>

  </cover-view>

  <view wx:else class=“float-share”>

    <button id=“share-btn” open-type=“share” plain=“true”>

      <image class=“share-img” src="/images/share_btn.png"></image>

    </button>

  </view>

canUseCoverView 写在js的data如下:

canUseCoverView: wx.canIUse(‘cover-view’)

我的虚拟机和真机都是1.4.0

请帮忙看一下是啥问题

1 回复

只可嵌套在原生组件mapvideocanvas内,请参考文档示例

https://mp.weixin.qq.com/debug/wxadoc/dev/component/cover-view.html

回到顶部