【bug】自定义组件的pageLifeTimes在部分iphone上无法触发
发布于 5 年前 作者 xia79 6239 次浏览 来自 问答

复现流程


写一个自定义组件ComponentA

写一个页面PageA

PageA中引入组件ComponentA

// app.json
{
    usingComponents: {
       'component-a''../component/ComponentA'
    }
}
// pageA.wxml
<view>
    <component-a/>
</view>
// componentA.js
Components({
   pageLifeTimes: {
      show() {
          console.log('show');
      }
   }
})

期待结果


在pageA onShow的时候,所有机型都应当在控制台打印出’show’.

实际结果


在部分ios机型,并未触发组件的pageLifeTimes的show方法。

复现机型


System: iphone, ios 11.1, WeChat 6.6.7WeChatLib: 2.1.3 (2018.7.9 22:47:33)

1 回复

提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

回到顶部