1、在项目中安装 jquery。
| npm install jquery --save-dev | 
2、在项目根目录下的 build/webpack.base.conf.js 文件中:
- 先写以下代码
| var webpack = require("webpack") | 
- 在 module.exports 的最后写
| plugins: [ | |
| new webpack.optimize.CommonsChunkPlugin('common.js'), | |
| new webpack.ProvidePlugin({ | |
| jQuery: "jquery", | |
| $: "jquery" | |
| }) | |
|   ] | 

3、在根目录下的 \src\main.js 中引入
| import $ from 'jquery' | 
4、此时在 vue 中全局引入了 jquery,可以在 script 中写 jquery 语法的代码。
