mirror of https://github.com/ElemeFE/element
Select: fix placeholder i18n bug (#17644)
parent
3ceec7aa6a
commit
7e22785a58
|
@ -145,7 +145,6 @@
|
||||||
import debounce from 'throttle-debounce/debounce';
|
import debounce from 'throttle-debounce/debounce';
|
||||||
import Clickoutside from 'element-ui/src/utils/clickoutside';
|
import Clickoutside from 'element-ui/src/utils/clickoutside';
|
||||||
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event';
|
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 scrollIntoView from 'element-ui/src/utils/scroll-into-view';
|
||||||
import { getValueByPath, valueEquals, isIE, isEdge } from 'element-ui/src/utils/util';
|
import { getValueByPath, valueEquals, isIE, isEdge } from 'element-ui/src/utils/util';
|
||||||
import NavigationMixin from './navigation-mixin';
|
import NavigationMixin from './navigation-mixin';
|
||||||
|
@ -235,6 +234,9 @@
|
||||||
return ['small', 'mini'].indexOf(this.selectSize) > -1
|
return ['small', 'mini'].indexOf(this.selectSize) > -1
|
||||||
? 'mini'
|
? 'mini'
|
||||||
: 'small';
|
: 'small';
|
||||||
|
},
|
||||||
|
propPlaceholder() {
|
||||||
|
return typeof this.placeholder !== 'undefined' ? this.placeholder : this.t('el.select.placeholder');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -288,9 +290,7 @@
|
||||||
},
|
},
|
||||||
placeholder: {
|
placeholder: {
|
||||||
type: String,
|
type: String,
|
||||||
default() {
|
required: false
|
||||||
return t('el.select.placeholder');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
defaultFirstOption: Boolean,
|
defaultFirstOption: Boolean,
|
||||||
reserveKeyword: Boolean,
|
reserveKeyword: Boolean,
|
||||||
|
@ -339,7 +339,7 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
placeholder(val) {
|
propPlaceholder(val) {
|
||||||
this.cachedPlaceHolder = this.currentPlaceholder = val;
|
this.cachedPlaceHolder = this.currentPlaceholder = val;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -838,7 +838,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.cachedPlaceHolder = this.currentPlaceholder = this.placeholder;
|
this.cachedPlaceHolder = this.currentPlaceholder = this.propPlaceholder;
|
||||||
if (this.multiple && !Array.isArray(this.value)) {
|
if (this.multiple && !Array.isArray(this.value)) {
|
||||||
this.$emit('input', []);
|
this.$emit('input', []);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue