Merge pull request #502 from baiyaaaaa/feat-input

fix textarea autosize bug
This commit is contained in:
杨奕 2016-10-19 13:54:40 +08:00 committed by GitHub
commit 8199c6ce76
2 changed files with 4 additions and 1 deletions

View File

@ -19,6 +19,7 @@
- Table 增加属性 rowClassName - Table 增加属性 rowClassName
- TableColumn 增加 fixed 属性可选值true, false, left, right - TableColumn 增加 fixed 属性可选值true, false, left, right
- TableColumn[type="selection"] 增加 selectable 属性 - TableColumn[type="selection"] 增加 selectable 属性
- 修复 Input textarea 在动态赋值时 autosize 没有触发的问题
#### 非兼容性更新 #### 非兼容性更新

View File

@ -168,10 +168,12 @@
watch: { watch: {
'value'(val, oldValue) { 'value'(val, oldValue) {
this.currentValue = val; this.currentValue = val;
this.resizeTextarea();
}, },
'currentValue'(val) { 'currentValue'(val) {
this.$nextTick(_ => {
this.resizeTextarea();
});
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val); this.$emit('change', val);
this.dispatch('form-item', 'el.form.change', [val]); this.dispatch('form-item', 'el.form.change', [val]);