Skip to content

Commit 397d6c0

Browse files
committed
docs(MdSlider): add api table, examples
1 parent 3b09016 commit 397d6c0

File tree

3 files changed

+71
-21
lines changed

3 files changed

+71
-21
lines changed
Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
<example src="./examples/Example.vue" />
2+
<example src="./examples/WithLabel.vue" />
23

34
<template>
45
<page-container centered :title="$t('pages.slider.title')">
56
<div class="page-container-section">
6-
<p>Lorem ipsum</p>
7+
<p>Sliders let users select from a range of values by moving the slider thumb. </p>
78
</div>
89

910
<div class="page-container-section">
1011
<h2>Slider</h2>
1112

12-
<code-example title="Example" :component="examples['example']" />
13+
<code-example title="Slider" :component="examples['example']" />
14+
<code-example title="Slider with label" :component="examples['with-label']" />
1315

1416
<api-item title="API - md-slider">
15-
<p>This component do not have any extra option.</p>
17+
<p>The following options can be applied to all sliders:</p>
18+
19+
<api-table :headings="props.headings" :props="props.props" slot="props" />
20+
21+
<note-block tip>All other <code>&lt;input type=&quot;range&quot;&gt;</code> attributes, such as <strong>name</strong> and <strong>required</strong>, can be used on <code>md-slider</code>.</note-block>
1622
</api-item>
1723
</div>
1824
</page-container>
@@ -22,7 +28,38 @@
2228
import examples from 'docs-mixins/docsExample'
2329
2430
export default {
25-
name: 'Slider',
26-
mixins: [examples]
31+
name: 'DocSlider',
32+
mixins: [examples],
33+
data: () => ({
34+
props: {
35+
headings: ['Name', 'Description', 'Default'],
36+
props: [
37+
{
38+
name: 'v-model',
39+
type: 'Number',
40+
description: 'The model variable to bind the selection value. If no value is assigned, then it will use default value.',
41+
defaults: '0'
42+
},
43+
{
44+
name: 'min',
45+
type: 'Number',
46+
description: 'Minimal value for slider.',
47+
defaults: '0'
48+
},
49+
{
50+
name: 'max',
51+
type: 'Number',
52+
description: 'Maximal value for slider.',
53+
defaults: '100'
54+
},
55+
{
56+
name: 'step',
57+
type: 'Number, String',
58+
description: 'Step value for slider.',
59+
defaults: '1'
60+
}
61+
]
62+
}
63+
})
2764
}
28-
</script>
65+
</script>

docs/app/pages/Components/Slider/examples/Example.vue

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
<template>
22
<div>
3-
<md-slider v-model="test" :max="20">
4-
Size
5-
</md-slider>
6-
7-
<md-slider v-model="test2">
8-
<md-icon>volume_up</md-icon>
9-
</md-slider>
10-
11-
<md-slider v-model="test2"></md-slider>
12-
13-
<md-slider v-model="test2" disabled>
14-
Disabled
15-
</md-slider>
3+
<md-slider v-model="slider"></md-slider>
4+
Disabled
5+
<md-slider disabled></md-slider>
166
</div>
177
</template>
188

@@ -21,8 +11,8 @@
2111
name: 'Example',
2212
data () {
2313
return {
24-
test: 5,
25-
test2: 0
14+
sliderMax: 0,
15+
slider: 0
2616
}
2717
}
2818
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<template>
2+
<div>
3+
<md-slider v-model="slider1">
4+
Size
5+
</md-slider>
6+
7+
<md-slider v-model="slider2">
8+
<md-icon>volume_up</md-icon>
9+
</md-slider>
10+
</div>
11+
</template>
12+
13+
<script>
14+
export default {
15+
name: 'Example',
16+
data () {
17+
return {
18+
slider1: 10,
19+
slider2: 50
20+
}
21+
}
22+
}
23+
</script>

0 commit comments

Comments
 (0)