From 6f784a3e36a852dd08006ba2fac85241e0cf05c8 Mon Sep 17 00:00:00 2001 From: jiaming743 <743192023@qq.com> Date: Thu, 4 Jul 2019 17:11:32 +0800 Subject: [PATCH] Strengthen autoResize stability --- src/mixin/autoResize.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mixin/autoResize.js b/src/mixin/autoResize.js index 00d9caf..68e68e6 100644 --- a/src/mixin/autoResize.js +++ b/src/mixin/autoResize.js @@ -17,7 +17,7 @@ export default { async autoResizeMixinInit () { const { initWH, getDebounceInitWHFun, bindDomResizeCallback, afterAutoResizeMixinInit } = this - await initWH() + await initWH(false) getDebounceInitWHFun() @@ -25,7 +25,7 @@ export default { if (typeof afterAutoResizeMixinInit === 'function') afterAutoResizeMixinInit() }, - initWH () { + initWH (resize = true) { const { $nextTick, $refs, ref, onResize } = this return new Promise(resolve => { @@ -35,7 +35,7 @@ export default { this.width = dom.clientWidth this.height = dom.clientHeight - if (typeof onResize === 'function') onResize() + if (typeof onResize === 'function' && resize) onResize() resolve() })