1.安装jquery

npm install jquery --save-dev

2.打开配置文件webpack.base.conf.js

加入'jquery': path.resolve(__dirname, '../node_modules/jquery/src/jquery') //引入jquery

vue 中引用jquery

3.main.js中引用jquery

import $ from "jquery"

vue 中引用jquery

4.测试

vue 中引用jquery

打印成功~引用成功

 

相关文章: