[improvement] Swipe: add indicator color prop (#2110)

This commit is contained in:
neverland
2018-11-20 21:00:09 +08:00
committed by GitHub
parent bf9db97921
commit acac16f4c5
5 changed files with 27 additions and 7 deletions
+8
View File
@@ -19,6 +19,7 @@
<i
v-for="index in count"
:class="b('indicator', { active: index - 1 === activeIndicator })"
:style="indicatorStyle"
/>
</div>
</slot>
@@ -40,6 +41,7 @@ export default create({
height: Number,
autoplay: Number,
vertical: Boolean,
indicatorColor: String,
loop: {
type: Boolean,
default: true
@@ -144,6 +146,12 @@ export default create({
transitionDuration: `${this.swiping ? 0 : this.duration}ms`,
transform: `translate${this.vertical ? 'Y' : 'X'}(${this.offset}px)`
};
},
indicatorStyle() {
return {
backgroundColor: this.indicatorColor
};
}
},