提交 e085f323 编写于 作者: H hdx

wip: slider-100

上级 9ff41b94
<template> <template>
<!-- #ifdef APP --> <!-- #ifdef APP -->
<scroll-view style="flex: 1"> <scroll-view class="page">
<!-- #endif --> <!-- #endif -->
<view class="uni-padding-wrap"> <page-head :title="title"></page-head>
<slider
class="first-slider"
@changing="sliderChanging"
:value="sliderValue"
:backgroundColor="sliderBackgroundColor"
:activeColor="sliderActiveColor"
:blockColor="sliderBlockColor"
:show-value="true"
/>
<view class="flex-row"> <view class="flex-row">
<view class="flex-fill"> <view class="flex-fill">
<slider <slider v-for="(_, index1) in 25" :key="index1" class="slider" @changing="sliderChanging" :value="sliderValue"
v-for="(_, index1) in 25" :block-size="sliderBlockSize" :show-value="true" />
:key="index1"
class="slider"
@changing="sliderChanging"
:value="sliderValue"
:block-size="sliderBlockSize"
:show-value="true"
/>
</view> </view>
<view class="flex-fill"> <view class="flex-fill">
<slider <slider v-for="(_, index2) in 25" :key="index2" class="slider" @changing="sliderChanging" :value="sliderValue"
v-for="(_, index2) in 25" :block-size="sliderBlockSize" :show-value="true" />
:key="index2"
class="slider"
@changing="sliderChanging"
:value="sliderValue"
:block-size="sliderBlockSize"
:show-value="true"
/>
</view> </view>
<view class="flex-fill"> <view class="flex-fill">
<slider <slider v-for="(_, index3) in 25" :key="index3" class="slider" @changing="sliderChanging" :value="sliderValue"
v-for="(_, index3) in 25" :block-size="sliderBlockSize" :show-value="true" />
:key="index3"
class="slider"
@changing="sliderChanging"
:value="sliderValue"
:block-size="sliderBlockSize"
:show-value="true"
/>
</view> </view>
<view class="flex-fill"> <view class="flex-fill">
<slider <slider v-for="(_, index4) in 25" :key="index4" class="slider" @changing="sliderChanging" :value="sliderValue"
v-for="(_, index4) in 25" :block-size="sliderBlockSize" :show-value="true" />
:key="index4"
class="slider"
@changing="sliderChanging"
:value="sliderValue"
:block-size="sliderBlockSize"
:show-value="true"
/>
</view>
</view> </view>
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
...@@ -64,16 +26,13 @@ ...@@ -64,16 +26,13 @@
<!-- #endif --> <!-- #endif -->
</template> </template>
<script lang="ts"> <script>
export default { export default {
data() { data() {
return { return {
title: 'slider 滑块 x 100', title: 'slider 滑块 x 100',
sliderValue: 50, sliderValue: 50,
sliderBlockSize: 20, sliderBlockSize: 20
sliderBackgroundColor: '#000000',
sliderActiveColor: '#FFCC33',
sliderBlockColor: '#8A6DE9',
} }
}, },
methods: { methods: {
...@@ -81,24 +40,28 @@ export default { ...@@ -81,24 +40,28 @@ export default {
this.sliderValue = e.detail.value this.sliderValue = e.detail.value
}, },
}, },
} }
</script> </script>
<style> <style>
.flex-row { .page {
flex: 1;
}
.flex-row {
flex-direction: row; flex-direction: row;
} }
.flex-fill { .flex-fill {
flex: 1; flex: 1;
} }
.first-slider { .first-slider {
margin: 12px 0; margin: 12px 0;
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
} }
.slider { .slider {
margin: 2px 0.5px; margin: 2px 0.5px;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册