Skip to content

Feature/double (range) slider #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: refactoring
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 30 additions & 12 deletions demo/App.vue
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
<template>
<div id="app">
<h1 class="heading">
This is DEMO of the Plugin in App
</h1>
<circle-slider
v-model="sliderValueOrZero"
v-model="sliderMaxValueOrZero"
:side="300"
:circleWidth="20"
:knobRadius="20"
:stepSize="10"
:maxKnobRadius="20"
:minKnobRadius="20"
:minValue="sliderMinValueOrZero"
@inputMin=" value => sliderMinValue = value "
:rangeSlider="true"
>
</circle-slider>
<div class="value"> {{ sliderValue }} </div>
<input type="number" v-model.number="sliderValue">
<div class="value"> {{ sliderMaxValue }} </div>
<input type="number" v-model.number="sliderMaxValue">
<input type="number" v-model.number="sliderMinValue">
<div class="min-value"> {{ sliderMinValue }} </div>
</div>
</template>

<script>
export default {
data () {
return {
sliderValue: 0
sliderMaxValue: 0,
sliderMinValue: 0,
// minKnobColor: '#EA1313'
}
},
computed: {
sliderValueOrZero: {
sliderMaxValueOrZero: {
get () {
return this.sliderValue === '' ? 0 : this.sliderValue
return this.sliderMaxValue === '' ? 0 : this.sliderMaxValue
},
set (value) {
this.sliderValue = value
this.sliderMaxValue = value
}
},
sliderMinValueOrZero: {
get () {
return this.sliderMinValue === '' ? 0 : this.sliderMinValue
},
set (value) {
this.sliderMinValue = value
}
}
}
Expand All @@ -41,6 +53,7 @@ export default {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 200px;
}

.heading {
Expand All @@ -55,6 +68,11 @@ export default {
margin-top: 20px;
}

.min-value {
font-size: 20px;
margin-top: 20px;
}

input {
height: 30px;
font-size: 20px;
Expand Down
Loading