我有一些默认的slickCarousel设置:
// Configure carousel settings
slickSettings = {
arrows: true,
dots: false,
infinite: false,
speed: 300,
}
我要根据不同的JS“案例”添加这些内容:
case attrValue == 'post-grid-image-over-text-1-column-carousel':
slickSettings.slidesToShow = 1;
slickSettings.slidesToScroll = 1;
break;
上面的添加项是简单的字符串,但是我的下一个添加项是数组。
我该如何最好地将其附加到slickSettings上?
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
},
},
{
breakpoint: 600,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
},
},
{
breakpoint: 480,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
},
},
],