mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix]: textarea filed height incorrect when display none
This commit is contained in:
parent
d4c70e824c
commit
b22e6e0230
@ -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