mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-24 15:39:15 +08:00
Merge pull request #188 from chenjiahan/dev
[bugfix]: textarea filed height incorrect when display none
This commit is contained in:
commit
3f79b3d179
@ -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';
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user