Merge pull request #188 from chenjiahan/dev

[bugfix]: textarea filed height incorrect when display none
This commit is contained in:
neverland
2017-10-10 21:23:30 -05:00
committed by GitHub

View File

@@ -89,7 +89,10 @@ export default {
mounted() {
if (this.autosize && this.type === 'textarea') {
const el = this.$refs.textarea;
el.style.height = el.scrollHeight + 'px';
const scrollHeight = el.scrollHeight;
if (scrollHeight !== 0) {
el.style.height = scrollHeight + 'px';
}
el.style.overflowY = 'hidden';
}
},