关于如何在vue中引入jquery?

相信大家有时候都会遇到在vue的项目中引入jquery,但是不会失效,今天就带领大家手把手在vue项目中引入jquery,亲测有效!

1、安装jquery

   npm install jquery --save

2、在入口文件main.js中引入jquery

	import jquery from "jquery";
 	Vue.prototype.$ = jquery;

3、在你需要用到的组件页面中引入

	import $ from 'jquery'

最后就可以在你的页面中使用了!

猜你喜欢

转载自blog.csdn.net/qq_47945175/article/details/123234143