在vue的項目中引入jquery:
1.安裝jquery插件
npm install jquery --save
2.配置jquery插件
在webpack.dev.conf.js文件中配置plugins,如:
plugins: [ new webpack.ProvidePlugin({ jQuery: 'jquery', $: 'jquery', "window.jQuery": "jquery" }) ]
3.在模塊中使用時引入'$'符,就能使用jquery
import $ from 'jquery'