您好,我创建了一个vue cli 3项目,并且尝试导入owl carousel 2,但是失败了。
这是我的main.js:
global.jQuery = require('jquery');
var $ = global.jQuery;
window.$ = $;
import "owl.carousel/dist/assets/owl.carousel.css";
import "owl.carousel";
import "bootstrap/dist/css/bootstrap.css";
import "bootstrap";
但是我在控制台上收到此错误:
owl.carousel.js?555f:1718 Uncaught TypeError: Cannot read property 'fn' of undefined
at eval (owl.carousel.js?555f:1718)
at eval (owl.carousel.js?555f:1755)
at Object../node_modules/owl.carousel/dist/owl.carousel.js (app.js:1829)
at __webpack_require__ (app.js:724)
at fn (app.js:101)
at Module.eval (main.js:14)
at eval (main.js:39)
at Module../src/main.js (app.js:2249)
at __webpack_require__ (app.js:724)
at fn (app.js:101)
答案 0 :(得分:0)
通过编写以下代码:
_Thread_local
它fiexd:)