我有一个 onsen-ui 项目,我正在使用 Monaca Cloud IDE 来构建它。当谈到 onsen-ui 时,我仍在为一些关键概念而苦苦挣扎,但我无法从准备文档中弄清楚。
目前我正在尝试在温泉轮播项目上实现“范围”输入。范围输入渲染得很好,但我不能滑动它。当我尝试滑动它时,我实际上滚动了旋转木马。我目前解决这个问题的想法是将整个轮播设置为“禁用”,因为用户滚动回上一页并不是那么重要(尽管那会很好)。我最大的问题之一是动作侦听器以及如何调用与 ons-.. 组件有关的方法。
<ons-page>
<ons-carousel fullscreen swipeable auto-scroll auto-scroll-ratio ="0.2">
<ons-carousel-item>
<img class="custom_logo_top_welcome" src="images/Leaf_PNG.png"/>
<br />
<br />
<br />
<p class="custom_p_welcome">Start saving today and see the likely value when you retire.</p>
<div class="custom_bottom_div_welcome"><p class="custom_bottom_p_welcome">Swipe left</p></div>
</ons-carousel-item>
<ons-carousel-item >
<p class="custom_dateOfBirth_p_setup">Please enter your date of birth:</p>
<div class="custom_datePicker_div_setup"><p>Test Div</p></div>
<p class="custom_dateOfRetirement_p_setup">What is your expected retirement age?</p>
<input type="range" class="range custom_range_setup" />
<div class="custom_bottom_div_setup"><ons-button class="custom_bottom_button_setup" onclick = "navToIndex()">Done</ons-button></div>
</ons-carousel-item>
</ons-carousel>
</ons-page>
所以基本上我在这里想做的是在用户滑动到第二个轮播项目时将轮播设置为“禁用”。
我该怎么做呢?如果有更好的解决问题的方法,请随时分享。
提前致谢!