# 卡片-滑杆
当设备可进行精细化的数值操作时,推荐使用本控件
交互原则
数值有较大的变化范围;数值变化控制的精确度要求相对较高;当变化间距很小时,可提供通过 + - 控件辅助操作;滑杆左右分别为可调整数值的最大和最小值,开关不与滑杆功能融合;滑杆支持点按(即可以通过点击直接调整到对应位置)和拖移
# 示例
<template>
<div class="wrapper">
<dof-minibar title="5.2卡片-滑杆"></dof-minibar>
<scroller class="scroller">
<dof-card class="m-b-16">
<div class="slider-text-box">
<text class="slider-text">温度</text>
<text class="divider">|</text>
<text class="slider-text">{{ value }}℃</text>
</div>
<dof-slider v-model="value" :min="10" :max="35">
<dof-slider-scale :value="10">10℃</dof-slider-scale>
<dof-slider-scale :value="35">35℃</dof-slider-scale>
</dof-slider>
</dof-card>
<dof-card class="m-b-16">
<div class="slider-text-box">
<text class="slider-text">温度</text>
<text class="divider">|</text>
<text class="slider-text">{{ value2 }}℃</text>
</div>
<dof-slider v-model="value2" :min="10" :max="35">
<dof-slider-scale :value="10">10℃</dof-slider-scale>
<dof-slider-scale :value="35">35℃</dof-slider-scale>
</dof-slider>
</dof-card>
<dof-card class="m-b-16">
<div class="slider-text-box">
<text class="slider-text">温度</text>
<text class="divider">|</text>
<text class="slider-text">{{ value }}℃</text>
</div>
<dof-slider v-model="value" :min="10" :max="35">
<dof-slider-scale :value="10">10℃</dof-slider-scale>
<dof-slider-scale :value="15">15℃</dof-slider-scale>
<dof-slider-scale :value="20">20℃</dof-slider-scale>
<dof-slider-scale :value="25">25℃</dof-slider-scale>
<dof-slider-scale :value="30">30℃</dof-slider-scale>
<dof-slider-scale :value="35">35℃</dof-slider-scale>
</dof-slider>
</dof-card>
<dof-card class="m-b-16">
<div class="slider-text-box">
<text class="slider-text">温度</text>
<text class="divider">|</text>
<text class="slider-text">{{ value }}℃</text>
</div>
<dof-step-action v-model="value" :min="10" :max="35">
<dof-slider v-model="value" :min="10" :max="35">
<dof-slider-scale :value="10">10℃</dof-slider-scale>
<dof-slider-scale :value="15">15℃</dof-slider-scale>
<dof-slider-scale :value="20">20℃</dof-slider-scale>
<dof-slider-scale :value="25">25℃</dof-slider-scale>
<dof-slider-scale :value="30">30℃</dof-slider-scale>
<dof-slider-scale :value="35">35℃</dof-slider-scale>
</dof-slider>
</dof-step-action>
</dof-card>
<dof-card class="m-b-16">
<div class="slider-text-box">
<text class="slider-text">温度</text>
<text class="divider">|</text>
<text class="slider-text">{{ value2 }}℃</text>
</div>
<dof-step-action v-model="value2" :min="10" :max="35">
<dof-slider v-model="value2" :min="10" :max="35" :gradientBarConfig="gradientBarConfig">
<dof-slider-scale :value="10">10℃</dof-slider-scale>
<dof-slider-scale :value="15">15℃</dof-slider-scale>
<dof-slider-scale :value="20">20℃</dof-slider-scale>
<dof-slider-scale :value="25">25℃</dof-slider-scale>
<dof-slider-scale :value="30">30℃</dof-slider-scale>
<dof-slider-scale :value="35">35℃</dof-slider-scale>
</dof-slider>
</dof-step-action>
</dof-card>
<dof-card class="m-b-16">
<dof-step-action vertical="middle" v-model="value" :min="10" :max="35">
<div class="slider-middle-box">
<div class="slider-middle-num-box">
<text class="slider-middle-num">{{ value }}</text>
<text class="slider-middle-desc">℃</text>
</div>
<text class="slider-middle-bottom">设置温度</text>
</div>
</dof-step-action>
<dof-slider v-model="value" :min="10" :max="35"> </dof-slider>
</dof-card>
<dof-card class="m-b-16">
<dof-step-action vertical="middle" v-model="value" :min="10" :max="35">
<div class="slider-middle-box">
<div class="slider-middle-num-box">
<text class="slider-middle-num">{{ value }}</text>
<text class="slider-middle-desc">℃</text>
</div>
<text class="slider-middle-bottom">设置温度</text>
</div>
</dof-step-action>
<dof-slider v-model="value" :min="10" :max="35" :gradientBarConfig="gradientBarConfig"></dof-slider>
</dof-card>
<dof-card class="m-b-16">
<dof-step-action vertical="middle" v-model="value" :min="10" :max="35">
<div class="slider-middle-box">
<div class="slider-middle-num-box">
<text class="slider-middle-num">{{ value }}</text>
<text class="slider-middle-desc">℃</text>
</div>
<text class="slider-middle-bottom">设置温度</text>
</div>
</dof-step-action>
<dof-slider v-model="value" :min="10" :max="35">
<dof-slider-scale :value="10">10℃</dof-slider-scale>
<dof-slider-scale :value="15">15℃</dof-slider-scale>
<dof-slider-scale :value="20">20℃</dof-slider-scale>
<dof-slider-scale :value="25">25℃</dof-slider-scale>
<dof-slider-scale :value="30">30℃</dof-slider-scale>
<dof-slider-scale :value="35">35℃</dof-slider-scale>
</dof-slider>
</dof-card>
</scroller>
</div>
</template>
<style scoped>
.wrapper {
background-color: #f9f9f9;
}
.scroller {
padding: 16px 30px;
}
.m-b-16 {
margin-bottom: 16px;
}
.slider-text-box {
margin-bottom: 30px;
display: flex;
flex-direction: row;
align-items: center;
}
.slider-text {
font-family: COLMO-Mono-Regular;
font-size: 32px;
color: rgba(255, 255, 255, 0.8);
}
.divider {
font-family: COLMO-Mono-Regular;
font-size: 28px;
color: rgba(255, 255, 255, 0.4);
margin: 0 14px;
}
.slider-middle-box {
display: flex;
flex-direction: column;
justify-content: center;
}
.slider-middle-num-box {
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-start;
}
.slider-middle-num {
font-size: 84px;
color: rgba(255, 255, 255, 0.8);
}
.slider-middle-bottom {
font-family: PingFangSC-Regular;
font-size: 24px;
color: rgba(255, 255, 255, 0.4);
text-align: center;
}
.slider-middle-desc {
font-size: 34px;
color: rgba(255, 255, 255, 0.8);
}
@media screen and (weex-theme: colmo) {
.wrapper {
background-color: #151617;
}
}
</style>
<script>
import { DofMinibar, DofSlider, DofSliderScale, DofCard, DofStepAction } from 'dolphin-weex-ui'
export default {
components: { DofMinibar, DofSlider, DofSliderScale, DofCard, DofStepAction },
data: () => ({
gradientBarConfig: { start: '#222324', end: '#fff' },
value: 10,
value2: 30
}),
computed: {},
created() {},
methods: {}
}
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
点我扫二维码 查看demo