diff --git a/examples/docs/zh-cn/alert.md b/examples/docs/zh-CN/alert.md similarity index 100% rename from examples/docs/zh-cn/alert.md rename to examples/docs/zh-CN/alert.md diff --git a/examples/docs/zh-cn/badge.md b/examples/docs/zh-CN/badge.md similarity index 100% rename from examples/docs/zh-cn/badge.md rename to examples/docs/zh-CN/badge.md diff --git a/examples/docs/zh-cn/breadcrumb.md b/examples/docs/zh-CN/breadcrumb.md similarity index 100% rename from examples/docs/zh-cn/breadcrumb.md rename to examples/docs/zh-CN/breadcrumb.md diff --git a/examples/docs/zh-cn/button.md b/examples/docs/zh-CN/button.md similarity index 100% rename from examples/docs/zh-cn/button.md rename to examples/docs/zh-CN/button.md diff --git a/examples/docs/zh-cn/card.md b/examples/docs/zh-CN/card.md similarity index 100% rename from examples/docs/zh-cn/card.md rename to examples/docs/zh-CN/card.md diff --git a/examples/docs/zh-cn/checkbox.md b/examples/docs/zh-CN/checkbox.md similarity index 100% rename from examples/docs/zh-cn/checkbox.md rename to examples/docs/zh-CN/checkbox.md diff --git a/examples/docs/zh-cn/color.md b/examples/docs/zh-CN/color.md similarity index 100% rename from examples/docs/zh-cn/color.md rename to examples/docs/zh-CN/color.md diff --git a/examples/docs/zh-cn/date-picker.md b/examples/docs/zh-CN/date-picker.md similarity index 100% rename from examples/docs/zh-cn/date-picker.md rename to examples/docs/zh-CN/date-picker.md diff --git a/examples/docs/zh-cn/datetime-picker.md b/examples/docs/zh-CN/datetime-picker.md similarity index 100% rename from examples/docs/zh-cn/datetime-picker.md rename to examples/docs/zh-CN/datetime-picker.md diff --git a/examples/docs/zh-cn/dialog.md b/examples/docs/zh-CN/dialog.md similarity index 100% rename from examples/docs/zh-cn/dialog.md rename to examples/docs/zh-CN/dialog.md diff --git a/examples/docs/zh-cn/dropdown.md b/examples/docs/zh-CN/dropdown.md similarity index 100% rename from examples/docs/zh-cn/dropdown.md rename to examples/docs/zh-CN/dropdown.md diff --git a/examples/docs/zh-cn/form.md b/examples/docs/zh-CN/form.md similarity index 100% rename from examples/docs/zh-cn/form.md rename to examples/docs/zh-CN/form.md diff --git a/examples/docs/zh-cn/home.md b/examples/docs/zh-CN/home.md similarity index 100% rename from examples/docs/zh-cn/home.md rename to examples/docs/zh-CN/home.md diff --git a/examples/docs/zh-cn/icon.md b/examples/docs/zh-CN/icon.md similarity index 100% rename from examples/docs/zh-cn/icon.md rename to examples/docs/zh-CN/icon.md diff --git a/examples/docs/zh-cn/input-number.md b/examples/docs/zh-CN/input-number.md similarity index 100% rename from examples/docs/zh-cn/input-number.md rename to examples/docs/zh-CN/input-number.md diff --git a/examples/docs/zh-cn/input.md b/examples/docs/zh-CN/input.md similarity index 100% rename from examples/docs/zh-cn/input.md rename to examples/docs/zh-CN/input.md diff --git a/examples/docs/zh-cn/installation.md b/examples/docs/zh-CN/installation.md similarity index 100% rename from examples/docs/zh-cn/installation.md rename to examples/docs/zh-CN/installation.md diff --git a/examples/docs/zh-cn/layout.md b/examples/docs/zh-CN/layout.md similarity index 100% rename from examples/docs/zh-cn/layout.md rename to examples/docs/zh-CN/layout.md diff --git a/examples/docs/zh-cn/loading.md b/examples/docs/zh-CN/loading.md similarity index 100% rename from examples/docs/zh-cn/loading.md rename to examples/docs/zh-CN/loading.md diff --git a/examples/docs/zh-cn/menu.md b/examples/docs/zh-CN/menu.md similarity index 100% rename from examples/docs/zh-cn/menu.md rename to examples/docs/zh-CN/menu.md diff --git a/examples/docs/zh-cn/message-box.md b/examples/docs/zh-CN/message-box.md similarity index 100% rename from examples/docs/zh-cn/message-box.md rename to examples/docs/zh-CN/message-box.md diff --git a/examples/docs/zh-cn/message.md b/examples/docs/zh-CN/message.md similarity index 100% rename from examples/docs/zh-cn/message.md rename to examples/docs/zh-CN/message.md diff --git a/examples/docs/zh-cn/notification.md b/examples/docs/zh-CN/notification.md similarity index 100% rename from examples/docs/zh-cn/notification.md rename to examples/docs/zh-CN/notification.md diff --git a/examples/docs/zh-cn/pagination.md b/examples/docs/zh-CN/pagination.md similarity index 100% rename from examples/docs/zh-cn/pagination.md rename to examples/docs/zh-CN/pagination.md diff --git a/examples/docs/zh-cn/popover.md b/examples/docs/zh-CN/popover.md similarity index 100% rename from examples/docs/zh-cn/popover.md rename to examples/docs/zh-CN/popover.md diff --git a/examples/docs/zh-cn/progress.md b/examples/docs/zh-CN/progress.md similarity index 100% rename from examples/docs/zh-cn/progress.md rename to examples/docs/zh-CN/progress.md diff --git a/examples/docs/zh-cn/quickstart.md b/examples/docs/zh-CN/quickstart.md similarity index 100% rename from examples/docs/zh-cn/quickstart.md rename to examples/docs/zh-CN/quickstart.md diff --git a/examples/docs/zh-cn/radio.md b/examples/docs/zh-CN/radio.md similarity index 100% rename from examples/docs/zh-cn/radio.md rename to examples/docs/zh-CN/radio.md diff --git a/examples/docs/zh-cn/rate.md b/examples/docs/zh-CN/rate.md similarity index 100% rename from examples/docs/zh-cn/rate.md rename to examples/docs/zh-CN/rate.md diff --git a/examples/docs/zh-cn/select.md b/examples/docs/zh-CN/select.md similarity index 100% rename from examples/docs/zh-cn/select.md rename to examples/docs/zh-CN/select.md diff --git a/examples/docs/zh-cn/slider.md b/examples/docs/zh-CN/slider.md similarity index 100% rename from examples/docs/zh-cn/slider.md rename to examples/docs/zh-CN/slider.md diff --git a/examples/docs/zh-cn/steps.md b/examples/docs/zh-CN/steps.md similarity index 100% rename from examples/docs/zh-cn/steps.md rename to examples/docs/zh-CN/steps.md diff --git a/examples/docs/zh-cn/switch.md b/examples/docs/zh-CN/switch.md similarity index 100% rename from examples/docs/zh-cn/switch.md rename to examples/docs/zh-CN/switch.md diff --git a/examples/docs/zh-cn/table.md b/examples/docs/zh-CN/table.md similarity index 100% rename from examples/docs/zh-cn/table.md rename to examples/docs/zh-CN/table.md diff --git a/examples/docs/zh-cn/tabs.md b/examples/docs/zh-CN/tabs.md similarity index 100% rename from examples/docs/zh-cn/tabs.md rename to examples/docs/zh-CN/tabs.md diff --git a/examples/docs/zh-cn/tag.md b/examples/docs/zh-CN/tag.md similarity index 100% rename from examples/docs/zh-cn/tag.md rename to examples/docs/zh-CN/tag.md diff --git a/examples/docs/zh-cn/time-picker.md b/examples/docs/zh-CN/time-picker.md similarity index 100% rename from examples/docs/zh-cn/time-picker.md rename to examples/docs/zh-CN/time-picker.md diff --git a/examples/docs/zh-cn/tooltip.md b/examples/docs/zh-CN/tooltip.md similarity index 100% rename from examples/docs/zh-cn/tooltip.md rename to examples/docs/zh-CN/tooltip.md diff --git a/examples/docs/zh-cn/tree.md b/examples/docs/zh-CN/tree.md similarity index 100% rename from examples/docs/zh-cn/tree.md rename to examples/docs/zh-CN/tree.md diff --git a/examples/docs/zh-cn/typography.md b/examples/docs/zh-CN/typography.md similarity index 100% rename from examples/docs/zh-cn/typography.md rename to examples/docs/zh-CN/typography.md diff --git a/examples/docs/zh-cn/upload.md b/examples/docs/zh-CN/upload.md similarity index 100% rename from examples/docs/zh-cn/upload.md rename to examples/docs/zh-CN/upload.md diff --git a/packages/date-picker/src/basic/date-table.vue b/packages/date-picker/src/basic/date-table.vue index c20886a4e..14cb63e75 100644 --- a/packages/date-picker/src/basic/date-table.vue +++ b/packages/date-picker/src/basic/date-table.vue @@ -8,14 +8,14 @@ :class="{ 'is-week-mode': selectionMode === 'week' }"> - {{ $t('el.datepicker.week') }} - {{ $t('el.datepicker.weeks.sun') }} - {{ $t('el.datepicker.weeks.mon') }} - {{ $t('el.datepicker.weeks.tue') }} - {{ $t('el.datepicker.weeks.wed') }} - {{ $t('el.datepicker.weeks.thu') }} - {{ $t('el.datepicker.weeks.fri') }} - {{ $t('el.datepicker.weeks.sat') }} + {{ t('el.datepicker.week') }} + {{ t('el.datepicker.weeks.sun') }} + {{ t('el.datepicker.weeks.mon') }} + {{ t('el.datepicker.weeks.tue') }} + {{ t('el.datepicker.weeks.wed') }} + {{ t('el.datepicker.weeks.thu') }} + {{ t('el.datepicker.weeks.fri') }} + {{ t('el.datepicker.weeks.sat') }} + v-text="cell.type === 'today' ? t('el.datepicker.today') : cell.text"> diff --git a/packages/date-picker/src/basic/month-table.vue b/packages/date-picker/src/basic/month-table.vue index 787a9ad7a..2cff86d9e 100644 --- a/packages/date-picker/src/basic/month-table.vue +++ b/packages/date-picker/src/basic/month-table.vue @@ -3,44 +3,44 @@ - {{ $t('el.datepicker.months.jan') }} + {{ t('el.datepicker.months.jan') }} - {{ $t('el.datepicker.months.feb') }} + {{ t('el.datepicker.months.feb') }} - {{ $t('el.datepicker.months.mar') }} + {{ t('el.datepicker.months.mar') }} - {{ $t('el.datepicker.months.apr') }} + {{ t('el.datepicker.months.apr') }} - {{ $t('el.datepicker.months.may') }} + {{ t('el.datepicker.months.may') }} - {{ $t('el.datepicker.months.jun') }} + {{ t('el.datepicker.months.jun') }} - {{ $t('el.datepicker.months.jul') }} + {{ t('el.datepicker.months.jul') }} - {{ $t('el.datepicker.months.aug') }} + {{ t('el.datepicker.months.aug') }} - {{ $t('el.datepicker.months.sep') }} + {{ t('el.datepicker.months.sep') }} - {{ $t('el.datepicker.months.oct') }} + {{ t('el.datepicker.months.oct') }} - {{ $t('el.datepicker.months.nov') }} + {{ t('el.datepicker.months.nov') }} - {{ $t('el.datepicker.months.dec') }} + {{ t('el.datepicker.months.dec') }} diff --git a/packages/date-picker/src/panel/date-range.vue b/packages/date-picker/src/panel/date-range.vue index e92b96982..326029a45 100644 --- a/packages/date-picker/src/panel/date-range.vue +++ b/packages/date-picker/src/panel/date-range.vue @@ -22,7 +22,7 @@ {{ $t('el.datepicker.clear') }} + @click="handleClear">{{ t('el.datepicker.clear') }} + :disabled="btnDisabled">{{ t('el.datepicker.confirm') }} @@ -152,11 +152,11 @@ }, leftLabel() { - return this.date.getFullYear() + ' ' + this.$t('el.datepicker.year') + ' ' + this.$t(`el.datepicker.month${ this.date.getMonth() + 1 }`); + return this.date.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t(`el.datepicker.month${ this.date.getMonth() + 1 }`); }, rightLabel() { - return this.rightDate.getFullYear() + ' ' + this.$t('el.datepicker.year') + ' ' + this.$t(`el.datepicker.month${ this.rightDate.getMonth() + 1 }`); + return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t(`el.datepicker.month${ this.rightDate.getMonth() + 1 }`); }, leftYear() { diff --git a/packages/date-picker/src/panel/date.vue b/packages/date-picker/src/panel/date.vue index 83aa7b92c..5b046d45b 100644 --- a/packages/date-picker/src/panel/date.vue +++ b/packages/date-picker/src/panel/date.vue @@ -23,7 +23,7 @@
@@ -33,7 +33,7 @@ ref="input" @focus="timePickerVisible = !timePickerVisible" v-model.lazy="visibleTime" - :placehoder="$t('el.datepicker.selectTime')" + :placehoder="t('el.datepicker.selectTime')" type="text" class="el-date-picker__editor"> {{$t(`el.datepicker.month${ month + 1 }`)}} + :class="{ active: currentView === 'month' }">{{t(`el.datepicker.month${ month + 1 }`)}} + @click="confirm">{{ t('el.datepicker.confirm') }}
@@ -421,7 +421,7 @@ yearLabel() { const year = this.year; if (!year) return ''; - const yearTranslation = this.$t('el.datepicker.year'); + const yearTranslation = this.t('el.datepicker.year'); if (this.currentView === 'year') { const startYear = Math.floor(year / 10) * 10; return startYear + ' ' + yearTranslation + '-' + (startYear + 9) + ' ' + yearTranslation; diff --git a/packages/date-picker/src/panel/time-range.vue b/packages/date-picker/src/panel/time-range.vue index 622b4302a..c61b63b35 100644 --- a/packages/date-picker/src/panel/time-range.vue +++ b/packages/date-picker/src/panel/time-range.vue @@ -6,7 +6,7 @@ class="el-time-range-picker el-picker-panel">
-
{{ $t('el.datepicker.startTime') }}
+
{{ t('el.datepicker.startTime') }}
-
{{ $t('el.datepicker.endTime') }}
+
{{ t('el.datepicker.endTime') }}
{{ $t('el.datepicker.cancel') }} + @click="handleCancel()">{{ t('el.datepicker.cancel') }} + :disabled="btnDisabled">{{ t('el.datepicker.confirm') }}
diff --git a/packages/date-picker/src/panel/time.vue b/packages/date-picker/src/panel/time.vue index df2d9b698..b1214e581 100644 --- a/packages/date-picker/src/panel/time.vue +++ b/packages/date-picker/src/panel/time.vue @@ -19,11 +19,11 @@ + @click="handleCancel">{{ t('el.datepicker.cancel') }} + @click="handleConfirm()">{{ t('el.datepicker.confirm') }}
diff --git a/packages/message-box/src/main.js b/packages/message-box/src/main.js index 0a2de1ecd..8d6fdeeb2 100644 --- a/packages/message-box/src/main.js +++ b/packages/message-box/src/main.js @@ -1,7 +1,7 @@ -import { $t } from 'element-ui/src/locale'; +import { t } from 'element-ui/src/locale'; -const CONFIRM_TEXT = $t('el.messagebox.confirm'); -const CANCEL_TEXT = $t('el.messagebox.cancel'); +const CONFIRM_TEXT = t('el.messagebox.confirm'); +const CANCEL_TEXT = t('el.messagebox.cancel'); const defaults = { title: '提示', diff --git a/packages/message-box/src/main.vue b/packages/message-box/src/main.vue index 16969f78b..38e2bdf1b 100644 --- a/packages/message-box/src/main.vue +++ b/packages/message-box/src/main.vue @@ -28,7 +28,7 @@ import ElInput from 'element-ui/packages/input'; import ElButton from 'element-ui/packages/button'; import { addClass, removeClass } from 'wind-dom/src/class'; - import { $t } from 'element-ui/src/locale'; + import { t } from 'element-ui/src/locale'; let typeMap = { success: 'circle-check', @@ -120,7 +120,7 @@ if (this.$type === 'prompt') { var inputPattern = this.inputPattern; if (inputPattern && !inputPattern.test(this.inputValue || '')) { - this.editorErrorMessage = this.inputErrorMessage || $t('el.messagebox.error'); + this.editorErrorMessage = this.inputErrorMessage || t('el.messagebox.error'); addClass(this.$refs.input.$el.querySelector('input'), 'invalid'); return false; } @@ -128,7 +128,7 @@ if (typeof inputValidator === 'function') { var validateResult = inputValidator(this.inputValue); if (validateResult === false) { - this.editorErrorMessage = this.inputErrorMessage || $t('el.messagebox.error'); + this.editorErrorMessage = this.inputErrorMessage || t('el.messagebox.error'); addClass(this.$refs.input.$el.querySelector('input'), 'invalid'); return false; } @@ -184,8 +184,8 @@ inputErrorMessage: '', showConfirmButton: true, showCancelButton: false, - confirmButtonText: $t('el.messagebox.confirm'), - cancelButtonText: $t('el.messagebox.cancel'), + confirmButtonText: t('el.messagebox.confirm'), + cancelButtonText: t('el.messagebox.cancel'), confirmButtonClass: '', confirmButtonDisabled: false, cancelButtonClass: '', diff --git a/packages/pagination/src/pagination.js b/packages/pagination/src/pagination.js index a972a8bca..5e7260ad3 100644 --- a/packages/pagination/src/pagination.js +++ b/packages/pagination/src/pagination.js @@ -2,7 +2,7 @@ import Pager from './pager.vue'; import ElSelect from 'element-ui/packages/select'; import ElOption from 'element-ui/packages/option'; import Migrating from 'element-ui/src/mixins/migrating'; -import { $t } from 'element-ui/src/locale'; +import { t } from 'element-ui/src/locale'; export default { name: 'ElPagination', @@ -137,7 +137,7 @@ export default { this.$parent.pageSizes.map(item => + label={ item + ' ' + t('el.pagination.pagesize') }> ) } @@ -183,7 +183,7 @@ export default { render(h) { return ( - { $t('el.pagination.goto') } + { t('el.pagination.goto') } - { $t('el.pagination.pageClassifier') } + { t('el.pagination.pageClassifier') } ); } @@ -204,7 +204,7 @@ export default { render(h) { return ( typeof this.$parent.total === 'number' - ? { $t('el.pagination.total', { total: this.$parent.total }) } + ? { t('el.pagination.total', { total: this.$parent.total }) } : '' ); } diff --git a/packages/select/src/select.vue b/packages/select/src/select.vue index a5fde7d6b..b69bd3fdb 100644 --- a/packages/select/src/select.vue +++ b/packages/select/src/select.vue @@ -73,7 +73,7 @@ import Clickoutside from 'element-ui/src/utils/clickoutside'; import { addClass, removeClass, hasClass } from 'wind-dom/src/class'; import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event'; - import { $t } from 'element-ui/src/locale'; + import { t } from 'element-ui/src/locale'; export default { mixins: [Emitter, Locale], @@ -110,17 +110,17 @@ emptyText() { if (this.loading) { - return this.$t('el.select.loading'); + return this.t('el.select.loading'); } else { if (this.voidRemoteQuery) { this.voidRemoteQuery = false; return false; } if (this.filterable && this.filteredOptionsCount === 0) { - return this.$t('el.select.noMatch'); + return this.t('el.select.noMatch'); } if (this.options.length === 0) { - return this.$t('el.select.noData'); + return this.t('el.select.noData'); } } return null; @@ -149,7 +149,7 @@ multiple: Boolean, placeholder: { type: String, - default: $t('el.select.placeholder') + default: t('el.select.placeholder') } }, diff --git a/packages/table/src/filter-panel.vue b/packages/table/src/filter-panel.vue index 0659832ff..68995dc3c 100644 --- a/packages/table/src/filter-panel.vue +++ b/packages/table/src/filter-panel.vue @@ -11,15 +11,15 @@
- + :disabled="filteredValue.length === 0">{{ t('el.table.confirmFilter') }} +
  • {{ $t('el.table.clearFilter') }}
  • + @click="handleSelect(null)">{{ t('el.table.clearFilter') }}
- - + +
); }, diff --git a/packages/table/src/table.vue b/packages/table/src/table.vue index 7cabbd0cb..3f1d4ee2e 100644 --- a/packages/table/src/table.vue +++ b/packages/table/src/table.vue @@ -94,7 +94,7 @@ import throttle from 'throttle-debounce/throttle'; import debounce from 'throttle-debounce/debounce'; import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event'; - import { $t } from 'element-ui/src/locale'; + import { t } from 'element-ui/src/locale'; import TableStore from './table-store'; import TableLayout from './table-layout'; import TableBody from './table-body'; @@ -137,7 +137,7 @@ emptyText: { type: String, - default: $t('el.table.emptyText') + default: t('el.table.emptyText') } }, diff --git a/packages/upload/src/cover.vue b/packages/upload/src/cover.vue index 1a0cc612b..429e1f291 100644 --- a/packages/upload/src/cover.vue +++ b/packages/upload/src/cover.vue @@ -19,9 +19,9 @@
- {{ $t('el.upload.continue') }} - {{ $t('el.upload.preview') }} - {{ $t('el.upload.delete') }} + {{ t('el.upload.continue') }} + {{ t('el.upload.preview') }} + {{ t('el.upload.delete') }}
diff --git a/packages/upload/src/upload-list.vue b/packages/upload/src/upload-list.vue index fc6865f8f..c66a26fe3 100644 --- a/packages/upload/src/upload-list.vue +++ b/packages/upload/src/upload-list.vue @@ -12,7 +12,7 @@ {{file.name}} - {{ $t('el.upload.delete') }} + {{ t('el.upload.delete') }}