javascript - How to introduce jquery with vue+webpack
滿天的星座
滿天的星座 2017-05-19 10:25:43
0
5
580

How to introduce jquery into vue webpack?

滿天的星座
滿天的星座

reply all(5)
淡淡烟草味

Just introduce cdn directly into index.html. No need to go to such trouble.

阿神

import $ from 'jquery'
首先 cnpm i --save jquery

習慣沉默
  1. npm i jquery --save import $ from jquery This will put jquery into the final generated bundle

  2. index.html引入,import $ from 'jquery', webpack 的配置项external里面加上 'jquery': 'jQuery' He will look for jquery from the overall perspective.

迷茫

wabpack introduces jquery

小葫芦

1.npm i jquery --save (you will still depend on jquery after publishing)
2. In the entry file main.js (depending on the entry file you configured), introduce import $ from 'jquery'

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template