emoji-mart-vue icon indicating copy to clipboard operation
emoji-mart-vue copied to clipboard

Nuxt support

Open tksumanth1994 opened this issue 6 years ago • 2 comments

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!

tksumanth1994 avatar Dec 26 '18 11:12 tksumanth1994

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

BrunoWilkinson avatar Jan 04 '19 02:01 BrunoWilkinson

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

giovannimanzoni avatar Mar 07 '20 22:03 giovannimanzoni