Strengthen autoResize stability

This commit is contained in:
jiaming743 2019-07-04 17:11:32 +08:00
parent 3e5b960abd
commit 6f784a3e36
1 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ export default {
async autoResizeMixinInit () { async autoResizeMixinInit () {
const { initWH, getDebounceInitWHFun, bindDomResizeCallback, afterAutoResizeMixinInit } = this const { initWH, getDebounceInitWHFun, bindDomResizeCallback, afterAutoResizeMixinInit } = this
await initWH() await initWH(false)
getDebounceInitWHFun() getDebounceInitWHFun()
@ -25,7 +25,7 @@ export default {
if (typeof afterAutoResizeMixinInit === 'function') afterAutoResizeMixinInit() if (typeof afterAutoResizeMixinInit === 'function') afterAutoResizeMixinInit()
}, },
initWH () { initWH (resize = true) {
const { $nextTick, $refs, ref, onResize } = this const { $nextTick, $refs, ref, onResize } = this
return new Promise(resolve => { return new Promise(resolve => {
@ -35,7 +35,7 @@ export default {
this.width = dom.clientWidth this.width = dom.clientWidth
this.height = dom.clientHeight this.height = dom.clientHeight
if (typeof onResize === 'function') onResize() if (typeof onResize === 'function' && resize) onResize()
resolve() resolve()
}) })