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

Lightest possible setup #34

Closed andreasvirkus closed 5 years ago

andreasvirkus commented 5 years ago

Hi,

I'm wondering what's the lightest possible setup (ie to display only native emojis) and to minimize the initial load time after component has mounted. I know this is somewhat related to https://github.com/jm-david/emoji-mart-vue/issues/9, but I was wondering why I'm seeing a long loading time even though I'm not providing any set for the component and setting :native="true" for the picker?

My setup currently:

<picker
      v-if="showPicker"
      v-click-outside="closePicker"
      :native="true"
      color="#475DE5"
      :showSkinTones="false"
      :showPreview="false"
      :sheetSize="16"
      @select="addEmoji"
      @keyup.esc.native="closePicker"
      :pickerStyles="pickerStyles"/>

I also tried the "visually hidden mount" hack but that's not really a favourable work-around 😞

andreasvirkus commented 5 years ago

Another question - how would I go about importing the namespaced export ({ Picker }) with webpack's async import? What I've tried so far is:

const { Picker } = () => import('emoji-mart-vue')

and also the simpler form:

components: {
  Picker: () => import('emoji-mart-vue')
}
EyMaddis commented 5 years ago

You are trying to do get Picker from a function, which does not work. This does: const Picker = () => import('emoji-mart-vue').then(({ Picker }) => Picker)

dimer22zhc commented 5 years ago

how do i prevent native emoji to joying up every fkin time