1

I try to using emojionearea with jquery in webpack like

import $ from 'jquery'
import emojione from 'emojione'

$('.class').emojioneArea({... })

I tested Jquery working well But when using emojioneArea that has error like

Uncaught TypeError: jquery__WEBPACK_IMPORTED_MODULE_1___default(...)(...).emojioneArea is not a function

How to make that working, thanks.

4

1 回答 1

1

According to the document, it looks like you import the wrong package name. It's supposed to be emojionearea instead of emojione. I think you also need to expose jquery in the global for other plugins too as following:

import $ from "jquery"
import 'emojionearea';

global.$ = global.jQuery = $;

$('.class').emojioneArea({ ... })
于 2020-09-16T15:47:11.037 回答