-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathexample.html
75 lines (65 loc) · 2.49 KB
/
example.html
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
<html>
<head>
<title>Vue.js Bootstrap Slider demo</title>
<link rel="stylesheet" href="https://unpkg.com/bootstrap-slider@latest/dist/css/bootstrap-slider.css">
<style type="text/css">
.secondary-slider {
background-image: linear-gradient(to bottom, #f9f9f9 0%, green 100%);
}
</style>
</head>
<body>
<div class="container">
<h1>Vue.js Bootstrap Slider demo</h1>
<div id="app">
<h1>Basic slider</h1>
<b-form-slider ref="basic" v-model="basicValue" :min="0" :max="100" trigger-change-event @slide-start="slideStart"></b-form-slider>
<p>Value of slider is {{ basicValue }}</p>
<h1>Vertical slider</h1>
<b-form-slider ref="vertical" v-model="basicValue" :min="0" :max="100" orientation="vertical"></b-form-slider>
<p>Value of slider is {{ basicValue }}</p>
<h1>Range slider</h1>
<b-form-slider ref="range" v-model="rangeValue" range :min="0" :max="100" trigger-change-event></b-form-slider>
<p>Value of slider is {{ rangeValue }}</p>
<h1>Ticked slider</h1>
<b-form-slider ref="ticks" v-model="simpleValue" :min="1" :max="3" :ticks="ticks" :ticks-labels="tickLabels"></b-form-slider>
<p>Value of slider is {{ simpleValue }}</p>
<h1>Range highlighted slider</h1>
<b-form-slider ref="rangeHighlights" :min="0" :max="119" :range-highlights="rangeHighlights">
</b-form-slider>
</div>
</div>
<script src="https://unpkg.com/vue@latest/dist/vue.min.js"></script>
<script src="https://unpkg.com/bootstrap-slider@latest/dist/bootstrap-slider.js"></script>
<script src="https://unpkg.com/vue-bootstrap-slider@latest/dist/vue-bootstrap-slider.js"></script>
<script>
const app = new Vue({
el: '#app',
data: function () {
return {
simpleValue: 2,
basicValue: 50,
rangeValue: [25, 75],
reactiveValue: 50,
min: 0,
max: 100,
ticks: [1, 2, 3],
tickLabels: ['One', 'Two', 'Three'],
rangeHighlights: [
{ 'start': 0, 'end': 24, 'class': 'primary-slider' },
{ 'start': 24, 'end': 47, 'class': 'secondary-slider' },
{ 'start': 47, 'end': 71, 'class': 'primary-slider' },
{ 'start': 71, 'end': 95, 'class': 'secondary-slider' },
{ 'start': 95, 'end': 119, 'class': 'primary-slider' }
]
}
},
methods: {
slideStart: function () {
console.log('slideStarted')
}
}
})
</script>
</body>
</html>