fix: transition collapse 动画根元素无法设置内边距
This commit is contained in:
@@ -58,7 +58,8 @@ const beforeLeave = (el: any) => {
|
||||
el.dataset.oldPaddingTop = el.style.paddingTop;
|
||||
el.dataset.oldPaddingBottom = el.style.paddingBottom;
|
||||
el.dataset.oldOverflow = el.style.overflow;
|
||||
el.style.height = el.scrollHeight + "px";
|
||||
var computedStyle = getComputedStyle(el, null);
|
||||
el.style.height = el.scrollHeight - parseInt(computedStyle.paddingTop) - parseInt(computedStyle.paddingBottom) + "px";
|
||||
el.style.overflow = "hidden";
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user