[bugfix] Collapse: fix collapse-item height error when set content async (#1094)

fix #1074
This commit is contained in:
Tony 2018-12-18 16:45:04 +08:00 committed by rex
parent 5aacd6ca1b
commit a1b87f510f

View File

@ -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