提交 54dfee40 编写于 作者: H hdx

fix(slider-100): 小程序平台其它 slider 无法跟随变动的问题

上级 03903c81
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<scroll-view class="page"> <scroll-view class="page">
<!-- #endif --> <!-- #endif -->
<page-head :title="title"></page-head> <page-head :title="title"></page-head>
<view class="grid-view"> <view class="grid-view">
<slider ref="slider" class="slider" v-for="(_, index) in 100" :key="index" @changing="sliderChanging" <slider ref="slider" class="slider" v-for="(_, index) in 100" :key="index" @changing="sliderChanging"
@change="sliderChange" :value="sliderValue" :block-size="20" :show-value="true" /> @change="sliderChange" :value="sliderValue" :block-size="20" :show-value="true" />
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
...@@ -32,11 +32,17 @@ ...@@ -32,11 +32,17 @@
sliderChanging(e : UniSliderChangeEvent) { sliderChanging(e : UniSliderChangeEvent) {
this.updateSliderValue(e.detail.value) this.updateSliderValue(e.detail.value)
}, },
updateSliderValue(value : number) { updateSliderValue(value : number) {
// TODO 跳过vue框架,直接修改原生组件 // #ifndef MP
(this.$refs["slider"] as UniSliderElement[]).forEach((item) => { // TODO 跳过vue框架,直接修改原生组件
item.value = value (this.$refs["slider"] as UniSliderElement[]).forEach((item) => {
}); item.value = value
});
// #endif
// #ifdef MP
this.sliderValue = value
// #endif
} }
}, },
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册