Skip to content

Commit

Permalink
fix: handle async component when parent is toggled before resolve (#9572
Browse files Browse the repository at this point in the history
)

fix #9571
  • Loading branch information
maoberlehner authored and yyx990803 committed Feb 28, 2019
1 parent 241eea1 commit ed34113
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/core/vdom/helpers/resolve-async-component.js
Expand Up @@ -8,7 +8,8 @@ import {
isTrue,
isObject,
hasSymbol,
isPromise
isPromise,
remove
} from 'core/util/index'

import { createEmptyVNode } from 'core/vdom/vnode'
Expand Down Expand Up @@ -51,17 +52,21 @@ export function resolveAsyncComponent (
return factory.resolved
}

const owner = currentRenderingInstance
if (isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
// already pending
factory.owners.push(owner)
}

if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
return factory.loadingComp
}

const owner = currentRenderingInstance
if (isDef(factory.owners)) {
// already pending
factory.owners.push(owner)
} else {
if (!isDef(factory.owners)) {
const owners = factory.owners = [owner]
let sync = true

if (owner) owner.$on('hook:destroyed', () => remove(owners, owner))

const forceRender = (renderCompleted: boolean) => {
for (let i = 0, l = owners.length; i < l; i++) {
Expand Down

0 comments on commit ed34113

Please sign in to comment.