step1:首先安装jquery

    npm install jquery --save

step2:在项目 build 里的webpack.base.conf.js 里加载webpack文件,注意,要放在配置文件第一行;
Vue 中 加载 jquery

step3:在module.exports的最后加入:
Vue 中 加载 jquery
在组件中引入jquery,进行使用

我们想在哪个组件中使用jQuery库,首先要使用如下命令引入jquery,然后就可以正常使用了

import $ from ‘jquery’
比如我们要在 App.vue组件中使用jQuery,实例代码如下:

Vue 中 加载 jquery

相关文章:

  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
相关资源
相似解决方案