fix(Swipe): incorrect size during ssr (#7821)

This commit is contained in:
neverland
2020-12-26 15:18:28 +08:00
committed by GitHub
parent b89832c03e
commit 76aa0e5dd9
5 changed files with 32 additions and 26 deletions
+3 -1
View File
@@ -25,7 +25,9 @@ export default createComponent({
const style = {};
const { size, vertical } = this.parent;
style[vertical ? 'height' : 'width'] = `${size}px`;
if (size) {
style[vertical ? 'height' : 'width'] = `${size}px`;
}
if (this.offset) {
style.transform = `translate${vertical ? 'Y' : 'X'}(${this.offset}px)`;