[improvement] Swipe: add indicator color prop (#2110)
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user