Currently, I am in the process of creating a button component. One issue that I have encountered is regarding the use of vm.$emit
to trigger a click event. The problem arises when attempting to inject $event
and other parameters into the handler, much like with a native HTML element shown below:
<button v-on:click="handler($event, 'other-parameter')" />
Upon using vm.$emit
, the handler only receives the argument passed into it, rather than the expected $event along with additional parameters. While one solution involves passing a function as props, my goal is for the component to behave similarly to a native HTML element. Is there a way to achieve this functionality? If so, HOW can it be accomplished?