0
我想在我的React應用程序中使用這個庫:http://propeller.in,但它建立在jQuery上。我已經加入我的Index.js以下相關的代碼陣營組成:如何在React.js中使用jQuery依賴節點模塊?
import $ from 'jquery';
import 'propellerkit/dist/js/propeller.js';
我也試過這樣:
import 'jquery/dist/js/jquery.js';
import 'propellerkit/dist/js/propeller.js';
我確信這兩個節點模塊安裝。出於某種原因,我不斷收到$ is not defined
錯誤。
你可以試試'進口*爲$從 'jQuery的';'但因爲我沒有不,我沒有發現它值得頂級答案。 – Brian
謝謝,但同樣的錯誤。 –
您是否嘗試'從'jquery/dist/js/jquery.js'導入*作爲$;''或者'只導入'jquery';'?這應該將jQuery暴露爲dist webpack創建的「全局」。 – Brian