0

I have a Vue 2 with Bootstrap application. I have many buttons that are similar to this:

<b-button variant="outline-secondary" title="..." v.b.tooltip.hover.bottom>
    <font-awesome-icon icon="..." />
</b-button>

The buttons differ in their titles and icons, but also in the event handlers used. In some places @click is used, in others @mouseenter, @mouseleave, and so on.

I want to wrap this into my own Vue component, so I can just specify a

<fancy-button title="..." icon="..." @eventA=... @eventB=... />

I want to do that without specifying all the event handlers on fancy-button, and without worrying about all the event modifiers. How can I do that?

zmbq
  • 38,013
  • 14
  • 101
  • 171

1 Answers1

0

The solution is described in this question

I just had to add v-on="$listeners" to fancy-button, and all events were passed to the parent without an issue.

zmbq
  • 38,013
  • 14
  • 101
  • 171