Skip to content

Commit

Permalink
Select: fix i18n bug of placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
nzh63 committed Oct 8, 2019
1 parent 45c0ef4 commit bf06240
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/select/src/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
import debounce from 'throttle-debounce/debounce';
import Clickoutside from 'element-ui/src/utils/clickoutside';
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event';
import { t } from 'element-ui/src/locale';
import scrollIntoView from 'element-ui/src/utils/scroll-into-view';
import { getValueByPath, valueEquals, isIE, isEdge } from 'element-ui/src/utils/util';
import NavigationMixin from './navigation-mixin';
Expand Down Expand Up @@ -235,6 +234,9 @@
return ['small', 'mini'].indexOf(this.selectSize) > -1
? 'mini'
: 'small';
},
propPlaceholder() {
return typeof this.placeholder !== 'undefined' ? this.placeholder : this.t('el.select.placeholder');
}
},
Expand Down Expand Up @@ -288,9 +290,7 @@
},
placeholder: {
type: String,
default() {
return t('el.select.placeholder');
}
required: false
},
defaultFirstOption: Boolean,
reserveKeyword: Boolean,
Expand Down Expand Up @@ -339,7 +339,7 @@
});
},
placeholder(val) {
propPlaceholder(val) {
this.cachedPlaceHolder = this.currentPlaceholder = val;
},
Expand Down Expand Up @@ -838,7 +838,7 @@
},
created() {
this.cachedPlaceHolder = this.currentPlaceholder = this.placeholder;
this.cachedPlaceHolder = this.currentPlaceholder = this.propPlaceholder;
if (this.multiple && !Array.isArray(this.value)) {
this.$emit('input', []);
}
Expand Down

0 comments on commit bf06240

Please sign in to comment.