fix multiple remote select's default value issue

pull/477/head
Leopoldthecoder 2016-10-17 23:20:47 +08:00 committed by cinwell.li
parent 4495877dff
commit 5352f31f16
2 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@
- 修复 DatePicker 弹出框样式溢出边框 #318 - 修复 DatePicker 弹出框样式溢出边框 #318
- 新增 Input 图标的点击事件 #444 - 新增 Input 图标的点击事件 #444
- 修复 Loading 关闭后有几率滚动失效的问题 - 修复 Loading 关闭后有几率滚动失效的问题
- 修复 远程搜索的 Select 不能正确渲染默认初始值的问题
#### 非兼容性更新 #### 非兼容性更新

View File

@ -528,6 +528,14 @@
}, },
mounted() { mounted() {
if (this.remote && this.multiple && Array.isArray(this.value)) {
this.selected = this.options.reduce((prev, curr) => {
return this.value.indexOf(curr.value) > -1 ? prev.concat(curr) : prev;
}, []);
this.$nextTick(() => {
this.resetInputHeight();
});
}
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.reference.$el) { if (this.$refs.reference.$el) {
this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width; this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;