File tree 6 files changed +18
-17
lines changed
6 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ export default {
125
125
},
126
126
mixins: [emitter],
127
127
inject: {
128
- t : {
128
+ translateFn : {
129
129
default : () => getLocaleFieldValue,
130
130
},
131
131
prefixClass: {
@@ -207,9 +207,9 @@ export default {
207
207
return this .panel === ' date' ;
208
208
},
209
209
dateHeader () {
210
- const monthBeforeYear = this .t (' monthBeforeYear' );
211
- const yearFormat = this .t (' yearFormat' );
212
- const monthFormat = this .t (' monthFormat' ) || ' MMM' ;
210
+ const monthBeforeYear = this .translateFn (' monthBeforeYear' );
211
+ const yearFormat = this .translateFn (' yearFormat' );
212
+ const monthFormat = this .translateFn (' monthFormat' ) || ' MMM' ;
213
213
const yearLabel = {
214
214
panel: ' year' ,
215
215
label: this .formatDate (this .innerCalendar , yearFormat),
@@ -235,7 +235,7 @@ export default {
235
235
},
236
236
methods: {
237
237
formatDate (date , fmt ) {
238
- return format (date, fmt, { locale: this .t (' formatLocale' ) });
238
+ return format (date, fmt, { locale: this .translateFn (' formatLocale' ) });
239
239
},
240
240
initCalendar () {
241
241
let calendarDate = this .calendar ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ import { getLocaleFieldValue } from '../locale';
39
39
export default {
40
40
name: ' TableDate' ,
41
41
inject: {
42
- t : {
42
+ translateFn : {
43
43
default : () => getLocaleFieldValue,
44
44
},
45
45
getWeek: {
@@ -85,10 +85,10 @@ export default {
85
85
},
86
86
computed: {
87
87
firstDayOfWeek () {
88
- return this .t (' formatLocale.firstDayOfWeek' ) || 0 ;
88
+ return this .translateFn (' formatLocale.firstDayOfWeek' ) || 0 ;
89
89
},
90
90
days () {
91
- const days = this .t (' days' ) || this .t (' formatLocale.weekdaysMin' );
91
+ const days = this .translateFn (' days' ) || this .translateFn (' formatLocale.weekdaysMin' );
92
92
return days .concat (days).slice (this .firstDayOfWeek , this .firstDayOfWeek + 7 );
93
93
},
94
94
dates () {
@@ -125,7 +125,7 @@ export default {
125
125
},
126
126
methods: {
127
127
formatDate (date , fmt ) {
128
- return format (date, fmt, { locale: this .t (' formatLocale' ) });
128
+ return format (date, fmt, { locale: this .translateFn (' formatLocale' ) });
129
129
},
130
130
handleCellClick (evt ) {
131
131
let { target } = evt;
@@ -148,7 +148,7 @@ export default {
148
148
const year = this .calendarYear ;
149
149
const month = this .calendarMonth ;
150
150
const date = createDate (year, month, day);
151
- return this .getWeek (date, this .t (' formatLocale' ));
151
+ return this .getWeek (date, this .translateFn (' formatLocale' ));
152
152
},
153
153
},
154
154
};
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import { getLocaleFieldValue } from '../locale';
21
21
export default {
22
22
name: ' TableMonth' ,
23
23
inject: {
24
- t : {
24
+ translateFn : {
25
25
default : () => getLocaleFieldValue,
26
26
},
27
27
prefixClass: {
@@ -38,7 +38,8 @@ export default {
38
38
},
39
39
computed: {
40
40
months () {
41
- const monthsLocale = this .t (' months' ) || this .t (' formatLocale.monthsShort' );
41
+ const monthsLocale =
42
+ this .translateFn (' months' ) || this .translateFn (' formatLocale.monthsShort' );
42
43
const months = monthsLocale .map ((text , month ) => {
43
44
return { text, month };
44
45
});
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ export default {
151
151
},
152
152
provide () {
153
153
return {
154
- t : this .getLocaleFieldValue ,
154
+ translateFn : this .getLocaleFieldValue ,
155
155
getWeek: this .getWeek ,
156
156
prefixClass: this .prefixClass ,
157
157
};
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export default {
40
40
name: ' ListOptions' ,
41
41
components: { ScrollbarVertical },
42
42
inject: {
43
- t : {
43
+ translateFn : {
44
44
default : () => getLocaleFieldValue,
45
45
},
46
46
prefixClass: {
@@ -99,7 +99,7 @@ export default {
99
99
},
100
100
methods: {
101
101
formatDate (date , fmt ) {
102
- return format (date, fmt, { locale: this .t (' formatLocale' ) });
102
+ return format (date, fmt, { locale: this .translateFn (' formatLocale' ) });
103
103
},
104
104
scrollToSelected () {
105
105
const element = this .$el .querySelector (' .active' );
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export default {
47
47
name: ' TimePanel' ,
48
48
components: { ListColumns, ListOptions },
49
49
inject: {
50
- t : {
50
+ translateFn : {
51
51
default : () => getLocaleFieldValue,
52
52
},
53
53
prefixClass: {
@@ -149,7 +149,7 @@ export default {
149
149
},
150
150
methods: {
151
151
formatDate (date , fmt ) {
152
- return format (date, fmt, { locale: this .t (' formatLocale' ) });
152
+ return format (date, fmt, { locale: this .translateFn (' formatLocale' ) });
153
153
},
154
154
isDisabled (date ) {
155
155
return this .disabledTime (new Date (date));
You can’t perform that action at this time.
0 commit comments