Есть такой class
class Slider {
constructor(option) {
this.slider = option.slider;
this.slide = option.slide;
this.prev = option.prev;
this.next = option.next;
this.indicator = option.indicator;
}
}
const slider = new Slider({
slider: document.querySelector('.text-slider'),
slide: document.querySelectorAll('.text-slider__slide'),
prev: document.querySelector('.text-slider__button--prev'),
next: document.querySelector('.text-slider__button--next'),
indicator: document.querySelector('.text-slider__indicator-index'),
});
slider();
При вызове slider() - вылетает ошибка:script.min.js:formatted:106 Uncaught TypeError: (intermediate value) is not a function
at Object.<anonymous> (script.min.js:formatted:106)
Код JS после минификации:, function(e, t) {
new class {
constructor(e) {
this.slider = e.slider,
this.slide = e.slide,
this.prev = e.prev,
this.next = e.next,
this.indicator = e.indicator
}
}
({
slider: document.querySelector(".text-slider"),
slide: document.querySelectorAll(".text-slider__slide"),
prev: document.querySelector(".text-slider__button--prev"),
next: document.querySelector(".text-slider__button--next"),
indicator: document.querySelector(".text-slider__indicator-index")
})() - на это указывает ошибку - Uncaught TypeError: (intermediate value) is not a function
}