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

[Question] How do you replace the emojis in your HTML? #11

Closed hfalucas closed 6 years ago

hfalucas commented 6 years ago

Just starting using this plugin, love the fact that is not opinionated but unfortunately, I'm having some troubles.

I have successfully been able to add the emojis to my HTML string, the problem is rendering them. How do you replace the emojis in your HTML using the Emoji component?

This is what I have so far: https://github.com/hfalucas/emoji-mart-vue-issue

jm-david commented 6 years ago

Hmm well the simplest solution would be to just use the native emoji and append that to the string. However, if you're looking to dynamically replace a string with Emoji components then I think the best way would be to use a render function. Something like this maybe... https://gist.github.com/jm-david/7f98c3ee4fe235c596cff26d7aa26b7b

hfalucas commented 6 years ago

Thank you so much for your example, I will give it a try as soon as I can 👍