:这里是父组件里写的主要代码:
父组件通过点击事件:
<a-button @click="draft2()"style="margin-left: 15px;">草稿程序</a-button>
事件方法:
draft2(){
this.draftid=1
this.$refs.modal.show(this.draftid)
},
传递组件:
<TaskModal
@submit="handleRelatedTask(arguments)"
ref="modal"
:type="$route.query.deviceType"
></TaskModal>
子组件接收值:
show(data) {
this.visible = true
console.log(data+"接收值");
this.getDeviceTaskByParas(data)
}