[new feature] Slider: add active-color、inactive-color prop (#2374)

This commit is contained in:
neverland
2018-12-25 21:51:46 +08:00
committed by GitHub
parent 282d8ba27b
commit 9ec78652e1
5 changed files with 50 additions and 18 deletions
+11 -1
View File
@@ -1,6 +1,7 @@
<template>
<div
:class="b({ disabled })"
:style="style"
@click.stop="onClick"
>
<div
@@ -35,6 +36,8 @@ export default create({
min: Number,
value: Number,
disabled: Boolean,
activeColor: String,
inactiveColor: String,
max: {
type: Number,
default: 100
@@ -50,10 +53,17 @@ export default create({
},
computed: {
style() {
return {
background: this.inactiveColor
};
},
barStyle() {
return {
width: this.format(this.value) + '%',
height: this.barHeight
height: this.barHeight,
background: this.activeColor
};
}
},