some component support i18n

some component support i18n
This commit is contained in:
梁灏 2017-01-11 21:02:55 +08:00
parent d33b51432d
commit 4ab118119a
13 changed files with 238 additions and 30 deletions

View file

@ -28,6 +28,7 @@
import Confirm from '../base/confirm.vue';
import Mixin from './mixin';
import Locale from '../../../mixins/locale';
import { initTimeDate } from '../util';
@ -35,7 +36,7 @@
const timePrefixCls = 'ivu-time-picker';
export default {
mixins: [Mixin],
mixins: [ Mixin, Locale ],
components: { TimeSpinner, Confirm },
data () {
return {
@ -61,7 +62,10 @@
},
visibleDate () {
const date = this.date;
return `${date.getFullYear()}${date.getMonth() + 1}`;
const month = date.getMonth() + 1;
const tYear = this.t('i.datepicker.year');
const tMonth = this.t(`i.datepicker.month${month}`);
return `${date.getFullYear()}${tYear} ${tMonth}`;
}
},
watch: {