vue-range-slider
Lazy for async
by Ea Bangalore
HTML
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/vue-range-slider.min.css">
<script src="https://unpkg.com/[email protected]/dist/vue-range-slider.min.js"></script>
<div id="app">
<div class="app-content">
<vue-range-slider v-model="value" :min="min" :max="max" step="0.1" :enable-cross="enableCross" @slide-end="sliding($event)">
<div class="diy-tooltip" slot="piecewise" >
<li><img src="http://placehold.it/60x60"/><p>Argentina</p></li>
<li><img src="http://placehold.it/60x60"/><p>Brazil</p></li>
<li><img src="http://placehold.it/60x60"/><p>United States</p></li>
<li><img src="http://placehold.it/60x60"/><p>Italy</p></li>
<li><img src="http://placehold.it/60x60"/><p>This is a very looooooooong text</p><p> that should collapse to the other line. Simple, isn't it?</p></li>
<li><img src="http://placehold.it/60x60"/><p>London</p></li>
<li><img src="http://placehold.it/60x60"/><p>Australia</p></li>
</div>
</vue-range-slider>
</div>
</div>
CSS
* {
margin:0;
padding:0;
box-sizing:border-box;
}
:root{
--slider-color:#2196f3;
}
.app-content {
padding:40px 15px;
}
.slider{
height:150px !important;
}
.slider-always{
width: 5px !important;
height: 100% !important;
cursor: w-resize !important;
left: 5px !important;
background: #2196f3 !important;
top:0 !important;
}
.slider-process{
border-radius: 0 !important;
background-color: #ffffff !important;
}
.slider-process:before,.slider-process:after {
content: "";
position: absolute;
left: 0;
width: 100%;
height: 5px;
background: var(--slider-color);
}
.slider-process:before{top:0}
.slider-process:after{bottom:0}
.slider-dot{border-radius:0 !important; box-shadow:none !important;}
.slider-always:active{
background:orange !important;
}
Vue
new Vue({
data() {
return {
value: [0,100]
}
},
created() {
this.min = 0
this.max = 250
this.enableCross = false
},
methods:{
sliding(steps){
console.log('steps',steps);
}
},
}).$mount('#app')