第一步:给我们子组件加上id标识
这里封装的是时间选择器
<v-dateTimePicker id="page" bind:showing="onConfirm" bind:canceling="onCancel"
wx:if="{{isShowpopup}}"/>
第二步:直接通过this.selectComponent("#page")调用方法
// 父组件调用子组件中的方法
this.selectComponent("#page").showPop('isShowpopup')
第三步:子组件里面声明这个方法
// 出生日期
showPop(data) {
this.setData({
isShowpopup: data
})
},