My App.js
import $ from 'jquery';
import fluidbox from 'fluidbox';
import FluidBoxWpGallery from './modules/FluidBoxWpGallery';
var fluidBoxWpGallery = new FluidBoxWpGallery();
My FluidBoxWpGallery ():
import $ from 'jquery';
class FluidBoxWpGallery {
constructor() {
this.els = $(".gallery a");
this.initFluidGallery();
}
initFluidGallery() {
this.els.each(function() {
$(this).attr('data-fluidbox','');
});
if($('[data-fluidbox]').length>0){
$('[data-fluidbox]').fluidbox();
}
}
}
export default FluidBoxWpGallery;
Все отлично работает ... элементы получают attr data-Fluidbox, но ошибка в строке15/16.Я думаю, в веб-пакете
Это вывод в консоли:
App.js?ver=4.9.8:10051 Uncaught TypeError: (0 , _jquery2.default) .
(...).fluidbox is not a function
at FluidBoxWpGallery.initFluidGallery (App.js?ver=4.9.8:10051)
at new FluidBoxWpGallery (App.js?ver=4.9.8:10041)
at Object.<anonymous> (App.js?ver=4.9.8:79)
at __webpack_require__ (App.js?ver=4.9.8:20)
at App.js?ver=4.9.8:40
at App.js?ver=4.9.8:43
Спасибо за помощь!