Skip to content

Vue Composition API: Listeners

Mike Lyttle edited this page May 9, 2023 · 1 revision

Class Component

    get includeNextButton(): boolean {
        return this.$listeners.clickNextButton !== undefined;
    }

Notes

  • $listeners has been removed and event handlers are now included in useAttrs, except for those listed as emitted events (which should be all of our custom events).
  • The simplest solution is to just add a separate prop that instructs what the behaviour should be. (In the above example, an includeNextButton boolean.)

Documentation

Clone this wiki locally