1、安裝jquery
npm install jquery --save
2、在項(xiàng)目 build 里的webpack.base.conf.js 里加載webpack文件 const webpack= require('webpack'),注意,要放在配置文件第一行
'use strict'
const webpack= require('webpack')? ? ? ? ? ?//添加這一行
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')?

3、在module.exports的最后加入
plugins:[
????new webpack.ProvidePlugin({
????????$:'jquery',
????????jQuery:'jquery'
????})
],

4、這要使用的jquery的.vue中引入jquery
import $ from 'jquery'
