Fixes #7959 by providing aria labels for buttons

This commit is contained in:
Chris Anderson 2017-11-02 00:29:54 -05:00 committed by 杨奕
parent c1da7a5c86
commit 52bbf4f3e1
3 changed files with 14 additions and 0 deletions

View File

@ -49,31 +49,37 @@
<button
type="button"
@click="prevYear"
:aria-label="t(`el.datepicker.prevYear`)"
class="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left">
</button>
<button
type="button"
@click="prevMonth"
v-show="currentView === 'date'"
:aria-label="t(`el.datepicker.prevMonth`)"
class="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left">
</button>
<span
@click="showYearPicker"
role="button"
class="el-date-picker__header-label">{{ yearLabel }}</span>
<span
@click="showMonthPicker"
v-show="currentView === 'date'"
role="button"
class="el-date-picker__header-label"
:class="{ active: currentView === 'month' }">{{t(`el.datepicker.month${ month + 1 }`)}}</span>
<button
type="button"
@click="nextYear"
:aria-label="t(`el.datepicker.nextYear`)"
class="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right">
</button>
<button
type="button"
@click="nextMonth"
v-show="currentView === 'date'"
:aria-label="t(`el.datepicker.nextMonth`)"
class="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right">
</button>
</div>

View File

@ -16,6 +16,10 @@ export default {
startTime: 'Start Time',
endDate: 'End Date',
endTime: 'End Time',
prevYear: 'Previous Year',
nextYear: 'Next Year',
prevMonth: 'Previous Month',
nextMonth: 'Next Month',
year: '',
month1: 'Jan',
month2: 'Feb',

View File

@ -16,6 +16,10 @@ export default {
startTime: 'Hora Inicial',
endDate: 'Fecha Final',
endTime: 'Hora Final',
prevYear: 'Año Anterior',
nextYear: 'Próximo Año',
prevMonth: 'Mes Anterior',
nextMonth: 'Próximo Mes',
year: 'Año',
month1: 'enero',
month2: 'febrero',