2👍
✅
foo
would need to be defined in the component using my-component
, not in my-component
itself.
Also, you’d need to do @click.native
, unless you’re specifically $emit
ing an event called click
in my-component
.
If you were to use @click="foo"
inside of this component on an html element it would work like you expect (a @click
on a component needs .native
).
Source:stackexchange.com