(fallbackVNode)
| 648 | }, |
| 649 | |
| 650 | fallback(fallbackVNode) { |
| 651 | if (!suspense.pendingBranch) { |
| 652 | return |
| 653 | } |
| 654 | |
| 655 | const { vnode, activeBranch, parentComponent, container, namespace } = |
| 656 | suspense |
| 657 | |
| 658 | // invoke @fallback event |
| 659 | triggerEvent(vnode, 'onFallback') |
| 660 | |
| 661 | const anchor = next(activeBranch!) |
| 662 | const mountFallback = () => { |
| 663 | suspense.isFallbackMountPending = false |
| 664 | if (!suspense.isInFallback) { |
| 665 | return |
| 666 | } |
| 667 | // mount the fallback tree |
| 668 | patch( |
| 669 | null, |
| 670 | fallbackVNode, |
| 671 | container, |
| 672 | anchor, |
| 673 | parentComponent, |
| 674 | null, // fallback tree will not have suspense context |
| 675 | namespace, |
| 676 | slotScopeIds, |
| 677 | optimized, |
| 678 | ) |
| 679 | setActiveBranch(suspense, fallbackVNode) |
| 680 | } |
| 681 | |
| 682 | const delayEnter = |
| 683 | fallbackVNode.transition && fallbackVNode.transition.mode === 'out-in' |
| 684 | if (delayEnter) { |
| 685 | suspense.isFallbackMountPending = true |
| 686 | activeBranch!.transition!.afterLeave = mountFallback |
| 687 | } |
| 688 | suspense.isInFallback = true |
| 689 | |
| 690 | // unmount current active branch |
| 691 | unmount( |
| 692 | activeBranch!, |
| 693 | parentComponent, |
| 694 | null, // no suspense so unmount hooks fire now |
| 695 | true, // shouldRemove |
| 696 | ) |
| 697 | |
| 698 | if (!delayEnter) { |
| 699 | mountFallback() |
| 700 | } |
| 701 | }, |
| 702 | |
| 703 | move(container, anchor, type) { |
| 704 | suspense.activeBranch && |
no test coverage detected