mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-09-09 12:13:22 +08:00
[bugfix] Collapse: fix collapse-item height error when set content async (#1094)
fix #1074
This commit is contained in:
parent
5aacd6ca1b
commit
a1b87f510f
@ -58,11 +58,9 @@ VantComponent({
|
|||||||
|
|
||||||
updateStyle(expanded) {
|
updateStyle(expanded) {
|
||||||
if (expanded) {
|
if (expanded) {
|
||||||
this.getRect('.van-collapse-item__content').then(res => {
|
this.set({
|
||||||
this.set({
|
contentHeight: 'auto'
|
||||||
contentHeight: res.height ? res.height + 'px' : null
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
this.set({
|
this.set({
|
||||||
contentHeight: 0
|
contentHeight: 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user