vue 中引用jquery

1.安装jquery

npm install jquery --save-dev

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

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

3.main.js中引用jquery

import $ from "jquery"

4.测试

打印成功~引用成功

原文地址:https://www.cnblogs.com/Byme/p/9895097.html