在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'