收藏
回答

root-portal组件在swiper内无法脱离文本

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug root-portal 微信iOS客户端 8.0.27 2.26.1

在swiper组件内的root-portal组件,在开发工具里运行正常,在真机运行的环境下,无法脱离swiper。

<swiper class="swiper-container">
  <swiper-item class="swiper-item">
    <button bindtap="toggle">显示 root-portal</button>
    <root-portal wx:if="{{ show }}">
      <view class="portal-content">
        root-portal 内容
      </view>
    </root-portal>
  </swiper-item>
</swiper>


.swiper-container{
  width100%;
  height50vh;
}


.portal-content {
  position: absolute;
  left40px;
  top40px;
  right40px;
  bottom40px;
  text-align: center;
  padding20px;
  background-color#ddd;
}


const app = getApp()


Page({
  data: {
    show: false,
  },
  toggle() {
    this.setData({
      show: !this.data.show,
    })
  },
})


真机环境下:

开发工具:

回答关注问题邀请回答
收藏

1 个回答

  • Demons
    Demons
    2022-09-16

    安卓哪个版本哪个机型,我这边华为无法复现

    2022-09-16
    有用
    回复 2
    • 捉鱼
      捉鱼
      2022-09-16
      很奇怪,昨天下午是一加8pro,小米6,iphone6s,还有iphoneX都不行,但是今天在没有改动的情况下只有iphone6s还是不行,其他机型都可以了。iphone6s的微信版本是8.0.10,系统版本是11.2.5
      2022-09-16
      回复
    • 捉鱼
      捉鱼
      2022-09-16
      似乎不只是swiper的问题,父节点上面有transform样式就会出现无法脱离文本的问题,一加8pro,小米6,iphone6s,还有iphoneX都不行
      代码片段:
      https://developers.weixin.qq.com/s/lRCRFjmH7dCc
      2022-09-16
      回复
登录 后发表内容