From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 07 四月 2021 23:25:29 +0800 Subject: [PATCH] 2021-04-07 --- src/components/Image/index.jsx | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/components/Image/index.jsx b/src/components/Image/index.jsx index 01bd23e..508c7be 100644 --- a/src/components/Image/index.jsx +++ b/src/components/Image/index.jsx @@ -6,6 +6,8 @@ let Img = new Image() Img.src = this.props.url + if (!this.ImageWrapDom) return + if (Img.complete) { this.setSize(Img.width, Img.height) } else { @@ -20,6 +22,7 @@ } setSize = (width, height) => { + if (!this.ImageWrapDom) return const { clientWidth, clientHeight } = this.ImageWrapDom if (!clientWidth || !clientHeight || !width || !height) return -- Gitblit v1.8.0