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.测试

打印成功~引用成功

 

posted @ 2018-11-02 11:05  abcByme  阅读(542)  评论(0)    收藏  举报