In Vue I have a main component that houses a child component which is loaded on the page with a button and the button triggers saveTaskComment(). This works perfectly, and I can get into the .finally portion of the child components function. HOwever, when it completes and gets to that point I want to make a call back to the parent component to call the method getInformation again. The way I have it right now that doesn't work so I guess $parent isn't correct in this case.
What do I need to do to get the method in teh childComponent to call the original function
mainComponent
methods: {
getInformation() {
this.$root.$emit('fetchCommentsEvent');
},
}
childComponent
saveTaskComment() {
/*function completes and gets to this step fine*/
.finally(() => {
this.$parent.getInformation();
});
}
finallyback to the parent and have the parentComponent to callgetInformation()when certain event was emitted. - josephting