I'm trying to call a function in the parent of a child.
I have created a component I can use on multiple pages in my Vue project, once the function has run I want to call a function on the parent.
I can achieve this by doing this.$parent.getLocations() - and it works.
However as this is a component I need getLocations() to be a variable this could be getPets() or getLunch() for example.
I am passing through 'Location' to the component so I can use that.
I have tried: '${this.$parent}.get${this.type}s()}' (this.type being Location) and this.$parent + ".get" + this.type +" s()
However neither trigger the function.
How do I make `getLocations a variable to run the function?