My components are nested three levels deep:
<GrandParent />
<Parent />
<Child />
In the Child
component, I have a button that, when double clicked, should call a function in the GrandParent
component.
<button @dblclick="this.$parent.callGrandParentFunction(model)"> Call Grandparent </button>
Using this.$parent
, I can only access methods from the Parent
component. Is there a way to go up one level higher and call a method from the GrandParent
component?
There is a similar question on SO but it's related to vue2.
VueJS Grandchild component call function in Great grandparent component