当前位置: 移动技术网 > IT编程>开发语言>JavaScript > vue 中引用jquery

vue 中引用jquery

2018年11月02日  | 移动技术网IT编程  | 我要评论

 

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

打印成功~引用成功

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网