jm-david / emoji-mart-vue

One component to pick them all 👊🏼
https://jm-david.github.io/emoji-mart-vue
BSD 3-Clause "New" or "Revised" License
603 stars 82 forks source link

onClick not working #24

Closed shaunc869 closed 6 years ago

shaunc869 commented 6 years ago

Hi!

I realize this is a rather basic question, so I apologize, but this doesn't seem to work:

<picker v-show="showEmojis" set="emojione" :style="{ position: 'absolute', bottom: '120px', right: '80px' }" title="" onClick="nsertEmoji" />

It renders great and hides/shows fine, but the onclick won't fire for the life of me, can you show a full example of how to properly define and call the methods? Thanks!

ReneS1991 commented 6 years ago

You shouldn't assign it to onClick but to @select, as in the following example:

<picker v-show="showEmojis" set="emojione" :style="{ position: 'absolute', bottom: '120px', right: '80px' }" title="" @select="nsertEmoji" />

And an additional note, if your code was a copy-paste, you got a typo: nsertEmoji => insertEmoji

shaunc869 commented 6 years ago

That worked perfectly, thanks!

jm-david commented 6 years ago

Thanks, I've updated the readme to properly reflect the events provided by the Emoji component.