From 62e0012952c27ffc38572a194bf4eb1cd3f501f7 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Tue, 7 Jul 2020 15:06:48 +0800 Subject: [PATCH] fix(Image): memory leak during SSR (#6721) --- src-next/image/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-next/image/index.js b/src-next/image/index.js index 008793a38..8903c1ce6 100644 --- a/src-next/image/index.js +++ b/src-next/image/index.js @@ -1,4 +1,4 @@ -import { createNamespace, isDef, addUnit } from '../utils'; +import { createNamespace, isDef, addUnit, inBrowser } from '../utils'; import Icon from '../icon'; const [createComponent, bem] = createNamespace('image'); @@ -71,7 +71,7 @@ export default createComponent({ created() { const { $Lazyload } = this; - if ($Lazyload) { + if ($Lazyload && inBrowser) { $Lazyload.$on('loaded', this.onLazyLoaded); $Lazyload.$on('error', this.onLazyLoadError); }