弹窗是自定义的,我的想法是把控制弹窗出现的代码写在子页面的onLoad里面,父页面只传一个true过来,已经在onLoad页面打印过了,数据true已经传过来了,不知道为什么弹窗没有出现
onLoad:function(e){
var add=e.add
if(add==true){
this.setData({
showModalStatus:true,//控制弹窗出现
});
}
},
<view class="drawer_box" wx:if="{{showModalStatus}}">
<!--drawer content-->
<view class="drawer_title">新设备名称</view>
<view class="drawer_content">
<view class="top grid">
<input class="input_base input_h30 col-1" bindinput="newName" placeholder="请输入设备名称"></input>
</view>
</view>
<view class="btn_ok" bindtap="yes" >确定</view>
</view>