Skip to content

Commit e7e2d9c

Browse files
committed
Add aria-label attributes to slider control buttons
1 parent 2505e46 commit e7e2d9c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/slider.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
/>
3232
</div>
3333
<template v-if="controlBtn">
34-
<button class="slider-btn slider-btn-left" @click.stop="prev">
34+
<button class="slider-btn slider-btn-left" :aria-label="prevBtnLabel" @click.stop="prev">
3535
<i class="slider-icon slider-icon-left" />
3636
</button>
37-
<button class="slider-btn slider-btn-right" @click.stop="next">
37+
<button class="slider-btn slider-btn-right" :aria-label="nextBtnLabel" @click.stop="next">
3838
<i class="slider-icon slider-icon-right" />
3939
</button>
4040
</template>
@@ -104,6 +104,14 @@ export default {
104104
type: Function,
105105
default: () => true,
106106
},
107+
prevBtnLabel: {
108+
type: String,
109+
default: 'Previous slide',
110+
},
111+
nextBtnLabel: {
112+
type: String,
113+
default: 'Next slide',
114+
},
107115
},
108116
data() {
109117
return {

0 commit comments

Comments
 (0)