组件的show函数不触发
// 组件
pageLifetimes: {
show: function() {
console.log('threeStep 组件 show....')
// 页面被展示
},
hide: function() {
// 页面被隐藏
},
resize: function(size) {
// 页面尺寸变化
}
}
修改后可以触发:
// 使用组件的主页面
<!-- display:none/block;这样写才能出发show函数 -->
<view style="display:{{(loginState && hasThreeStep === 1)?'block':'none'}}" class="step-three">
<!-- <view wx:if="{{loginState && hasThreeStep === 1}}" class="step-three"> -->
<three-step></three-step>
</view>
网友评论