If you download it with npm, you can directly use import $ from 'jquery'. If you downloaded the library manually, you can try var $ = require('jquery path'). If you have to use import to introduce it, then open the jquery library and manually set export at the bottom of the closure to export jquery
ES6 module mainly has two functions: export and import export is used to export the interface of variables of this module (a file can be understood as a module) import is used to load another module containing the export interface in a module. That is to say, after using the export command to define the external interface of the module, other JS files can load this module (file) through the import command. So please check whether jquery supports export or module.export.
2. Install jQuery package directly
3. For error message, you can refer to this: https://stackoverflow.com/que...
If you download it with npm, you can directly use import $ from 'jquery'.
If you downloaded the library manually, you can try var $ = require('jquery path').
If you have to use import to introduce it, then open the jquery library and manually set export at the bottom of the closure to export jquery
Since they are all introduced globally.
Is there any difference?
Introducing jq into react, what is your starting point? . .
1. export(module.export) and import
ES6 module mainly has two functions: export and import
export is used to export the interface of variables of this module (a file can be understood as a module)
import is used to load another module containing the export interface in a module.
That is to say, after using the export command to define the external interface of the module, other JS files can load this module (file) through the import command.
So please check whether jquery supports export or module.export.
2. Install jQuery package directly
3. For error message, you can refer to this: https://stackoverflow.com/que...
Your package is not a standard npm package. It is recommended that you use npm to install jQuery and then use