1.父组件
//子组件名
<Flow :item ="this.item" @lcList="flowList"></Flow>
data() {
return {
item:{
page:'add'
},
}
},
methods:{
getBmOption(val){
//这里传的值 一定要写成对象的类型,如果直接赋值,子组件是接收不到的
this.item = {page:'add',type:'RB_RYRZ',deptId:String(val.id)}
this.form.sybm = String(val.label)
this.deptIdShow =true;
},
}
2.子组件
props: {
item: {
type: Object
}
},
watch: {
item(newval,oldval){
this.queryParams.deptId = newval.deptId
this.queryParams.type = newval.type
}
}