Home > Article > Web Front-end > How to import jquery third-party plug-in in vue scaffolding
How to import jquery third-party plug-in into vue scaffolding: 1. Download jquery; 2. Edit the webpack.base.conf.js file, introduce webpack, and configure the jquery plug-in; 3. Enter [import in the entry file $ from 'jquery'].
The operating environment of this tutorial: Windows 10 system, vue version 2.9. This method is suitable for all brands of computers.
(Learning video sharing: javascript video tutorial)
1. Download jquery
npm install jquery --save
2. Open webpack.base in the build folder. conf.js file:
(1) Introduce webpack at the top
var webpack=require('webpack')
(2) Configure the JQuery plug-in in module.exports:
plugins: [ new webpack.ProvidePlugin({ $:"jquery", jQuery:"jquery", "windows.jQuery":"jquery" }) ],
3. In the entry file Enter
import $ from 'jquery'
in main.js 4. Test using
Related recommendations: vue.js tutorial
The above is the detailed content of How to import jquery third-party plug-in in vue scaffolding. For more information, please follow other related articles on the PHP Chinese website!