I have a component and want to add a click listener that runs a method in the parent template in Vue. Is this possible?
Yes!
It's possible to call a parent method from a child and it's very easy.
Each Vue component define the property $parent
. From this property you can then call any method that exist in the parent.
Here is a JSFiddle that does it : https://jsfiddle.net/50qt9ce3/1/
Click me!
Note: While it's not recommended to do this kind of thing when you are building disconnected reusable components, sometimes we are building related non-reusable component and in this case it's very handy.