Skip to content

v-slot:activator={ on } does not works for other components I built? #11667

Discussion options

You must be logged in to vote

Your component doesn't support any events, so for example if you do

<my-test @click="showAlert" />

nothing will happen when you click it. You could use native events to fix it <my-test @click.native="showAlert" /> but that's not what v-on does.

Solution:

// my-test.vue
<template>
  <h3 v-on="$listeners">
    test
  </h3>
</template>

https://codepen.io/jkarczm/pen/WNroLbX

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KaelWD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants