|
3 | 3 | <div :class="`${prefixClass}-calendar-header`"> |
4 | 4 | <icon-button |
5 | 5 | type="double-left" |
| 6 | + :aria-label="locale.prev" |
6 | 7 | :disabled="isDisabledArrows('last-decade')" |
7 | 8 | @click="handleIconDoubleLeftClick" |
8 | 9 | ></icon-button> |
9 | | - <icon-button |
10 | | - type="double-right" |
11 | | - :disabled="isDisabledArrows('next-decade')" |
12 | | - @click="handleIconDoubleRightClick" |
13 | | - ></icon-button> |
14 | 10 | <span :class="`${prefixClass}-calendar-header-label`"> |
15 | 11 | <span>{{ firstYear }}</span> |
16 | 12 | <span :class="`${prefixClass}-calendar-decade-separator`"></span> |
17 | 13 | <span>{{ lastYear }}</span> |
18 | 14 | </span> |
| 15 | + <icon-button |
| 16 | + type="double-right" |
| 17 | + :aria-label="locale.next" |
| 18 | + :disabled="isDisabledArrows('next-decade')" |
| 19 | + @click="handleIconDoubleRightClick" |
| 20 | + ></icon-button> |
19 | 21 | </div> |
20 | 22 | <div :class="`${prefixClass}-calendar-content`"> |
21 | 23 | <table :class="`${prefixClass}-table ${prefixClass}-table-year`" @click="handleClick"> |
|
39 | 41 | import IconButton from './icon-button'; |
40 | 42 | import { chunk } from '../util/base'; |
41 | 43 | import { setYear } from '../util/date'; |
| 44 | +import { getLocale } from '../locale'; |
42 | 45 |
|
43 | 46 | export default { |
44 | 47 | name: 'TableYear', |
45 | 48 | components: { IconButton }, |
46 | 49 | inject: { |
| 50 | + getLocale: { |
| 51 | + default: () => getLocale, |
| 52 | + }, |
47 | 53 | prefixClass: { |
48 | 54 | default: 'mx', |
49 | 55 | }, |
@@ -80,6 +86,9 @@ export default { |
80 | 86 | const last = arr => arr[arr.length - 1]; |
81 | 87 | return last(last(this.years)); |
82 | 88 | }, |
| 89 | + locale() { |
| 90 | + return this.getLocale(); |
| 91 | + }, |
83 | 92 | }, |
84 | 93 | methods: { |
85 | 94 | isDisabledArrows(type) { |
|
0 commit comments