Continuing from the previous chapter, the previous method still feels a bit cumbersome. Is there a simpler method? Have!
We add a .sync
decorator to the dialog-info tag in the outer parent component :
delete the @statusChangeHide directly:
The following change method is also deleted:
And remove it from the return object, then go back to the child component DialogInfo
, delete the $emit statement in the previous handleClose callback function:
replace it with:
this.$emit("update:visible", false)
Note that there can be no spaces between "update:visible"!
This also achieves the desired effect