Description: VUE-CLI is the command-line development mode for Vue quick Build project.
Vue mainly for the data layer, more operations on the data, rarely on the DOM, occasionally also need to operate the DOM, occasionally also use the JQ plug-in, the following simple how to use VUE-CLI development time to set the JQ as a global public method.
Steps:
1. NPM Install Jquery-s
The latest version of jquery is automatically added to the Package.json, and if you need to specify a version, you can specify it at the time of installation.
Such as
2. Open build/webpack.base.conf.js file, add one line first:var webpack = require ("Webpack")
Add the location of the plugin on Webpack below
3, at this time has succeeded the JQ is set to a global, when used can be as normal as using script!
How to set jquery to global when using the VUE-CLI development process