【发布时间】:2021-06-29 09:49:34
【问题描述】:
我正在尝试根据获取我 a 值的小部件名称参数来禁用 swiper 自动播放。 (我使用 magento 小部件,我从 widget.xml 中获取值) 这是一个例子:
simulateTouch: <?= ($block->getData('is_gestures') == "1") ?'true':'false'?>,
// ---- gestures end -----
freeMode: true,
// --- infinite loop -----
loop: <?= ($block->getData('infiniteLoop') == "1") ?'true':'false'?>,
// --- autoplay ----
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
使用其他值很容易,因为它是真假,但在这种情况下,如果我的 $block->getData('autoplay') == "1" 但我不知道该怎么做,我需要显示该代码我试过了
<?= ($block->getData(‘autoplay’) == "1") ?{ delay: 2500, disableOnInteraction: false, },:''?>, or with the code inside '' but it bugs my swiper all the time
【问题讨论】: