驼峰命名试过了,命名全部小写试过了,dc_modal试过了,this.parent试过了都不行
父组件
<dcModel :ifVisible="dcVisible"
:menuId="'1010001'"
@modalCancel="dcModal">
</dcModel>
import dcModel from '../../dcsp/dcModal'
components: { dcModel },
data() {
return {
dcVisible: false
}
}
methods:{
dcModal(value) {debugger
this.dcVisible = value
},
}
子组件
props: ['ifVisible', 'menuId'],
methods: {
modalCancel() {
this.sqmc = undefined
this.sqsy = undefined
this.spr = undefined
this.$emit("dcModal", false)
}
}