|
@@ -15,7 +15,7 @@
|
|
|
<div class="el-picker-panel__body">
|
|
|
<div class="el-date-picker__time-header" v-if="showTime">
|
|
|
<input
|
|
|
- placehoder="选择日期"
|
|
|
+ :placehoder="$t('datepicker.selectDate')"
|
|
|
type="text"
|
|
|
v-model="visibleDate"
|
|
|
class="el-date-picker__editor">
|
|
@@ -23,7 +23,7 @@
|
|
|
<input
|
|
|
@focus="timePickerVisible = true"
|
|
|
v-model="visibleTime"
|
|
|
- placehoder="选择时间"
|
|
|
+ :placehoder="$t('datepicker.selectTime')"
|
|
|
type="text"
|
|
|
class="el-date-picker__editor">
|
|
|
<time-picker
|
|
@@ -53,7 +53,7 @@
|
|
|
@click="showMonthPicker"
|
|
|
v-show="currentView === 'date'"
|
|
|
class="el-date-picker__header-label"
|
|
|
- :class="{ active: currentView === 'month' }">{{ month + 1 }}月</span>
|
|
|
+ :class="{ active: currentView === 'month' }">{{ month + 1 }} {{$t('datepicker.month')}}</span>
|
|
|
<button
|
|
|
type="button"
|
|
|
@click="nextYear"
|
|
@@ -100,7 +100,7 @@
|
|
|
<a
|
|
|
href="JavaScript:"
|
|
|
class="el-picker-panel__link-btn"
|
|
|
- @click="changeToToday">{{ $t('datepicker.today') }}</a>
|
|
|
+ @click="changeToToday">{{ $t('datepicker.now') }}</a>
|
|
|
<button
|
|
|
type="button"
|
|
|
class="el-picker-panel__btn"
|
|
@@ -148,7 +148,9 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- $t: $t,
|
|
|
+ $t(...args) {
|
|
|
+ return $t.apply(this, args);
|
|
|
+ },
|
|
|
|
|
|
resetDate() {
|
|
|
this.date = new Date(this.date);
|
|
@@ -383,11 +385,12 @@
|
|
|
yearLabel() {
|
|
|
const year = this.year;
|
|
|
if (!year) return '';
|
|
|
+ const yearTranslation = this.$t('datepicker.year');
|
|
|
if (this.currentView === 'year') {
|
|
|
const startYear = Math.floor(year / 10) * 10;
|
|
|
- return startYear + '年' + '-' + (startYear + 9) + '年';
|
|
|
+ return startYear + ' ' + yearTranslation + '-' + (startYear + 9) + ' ' + yearTranslation;
|
|
|
}
|
|
|
- return this.year + '年';
|
|
|
+ return this.year + ' ' + yearTranslation;
|
|
|
},
|
|
|
|
|
|
hours: {
|