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

Nuxt support #46

Open tksumanth1994 opened 5 years ago

tksumanth1994 commented 5 years ago

Right now, I'm getting "document" not defined error when adding it as a plugin for server-side rendering.

Can you add nuxt support to this library or a workaround on how to use it for nuxt. That would be awesome.

Related to #21

Thanks!

BrunoWilkinson commented 5 years ago

I found the solution with this article:

https://medium.com/@codebeast_/why-your-third-party-plugin-dont-work-in-nuxt-and-how-to-fix-it-d1a8caadf422

Here's how my plugin looks, you need to include both.

import { NimblePicker, Picker } from 'emoji-mart-vue'
import Vue from 'vue'

const EmojiPicker = {
  install(Vue, options) {
    Vue.component('picker', Picker)
    Vue.component('nimble-picker', NimblePicker)
  }
}

Vue.use(EmojiPicker)

export default EmojiPicker
giovannimanzoni commented 4 years ago

And what about enable ssr ? is it wrong or a good thing ?