How to set jquery to global when using the VUE-CLI development process

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.