3👍
✅
in a parent component:
@back-to-parent="onBackToParent"
...
methods: {
onBackToParent({ data, done }) {
// process data
if (done) {
done()
}
}
}
in a child component:
clickevent(data){
this.$emit('back-to-parent', {data, done: () => {
alert('done')
} });
}
Source:stackexchange.com