fix(Teleport): fallback to non-optimized mode when HRM performing updates (#3311)
fix #3302
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
import { VNode, VNodeArrayChildren, VNodeProps } from '../vnode'
|
||||
import { isString, ShapeFlags } from '@vue/shared'
|
||||
import { warn } from '../warning'
|
||||
import { isHmrUpdating } from '../hmr'
|
||||
|
||||
export type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>
|
||||
|
||||
@@ -85,6 +86,13 @@ export const TeleportImpl = {
|
||||
const disabled = isTeleportDisabled(n2.props)
|
||||
const { shapeFlag, children } = n2
|
||||
|
||||
// #3302
|
||||
// HMR updated, force full diff
|
||||
if (__DEV__ && isHmrUpdating) {
|
||||
optimized = false
|
||||
n2.dynamicChildren = null
|
||||
}
|
||||
|
||||
if (n1 == null) {
|
||||
// insert anchors in the main view
|
||||
const placeholder = (n2.el = __DEV__
|
||||
|
||||
Reference in New Issue
Block a user