mirror of https://github.com/vuejs/core.git
fix(teleport): do not throw target warning when teleport is disabled (#9818)
This commit is contained in:
parent
cdb1d1795d
commit
15ee43f66a
|
@ -47,14 +47,13 @@ const resolveTarget = <T = RendererElement>(
|
|||
return null
|
||||
} else {
|
||||
const target = select(targetSelector)
|
||||
if (!target) {
|
||||
__DEV__ &&
|
||||
warn(
|
||||
`Failed to locate Teleport target with selector "${targetSelector}". ` +
|
||||
`Note the target element must exist before the component is mounted - ` +
|
||||
`i.e. the target cannot be rendered by the component itself, and ` +
|
||||
`ideally should be outside of the entire Vue component tree.`,
|
||||
)
|
||||
if (__DEV__ && !target && !isTeleportDisabled(props)) {
|
||||
warn(
|
||||
`Failed to locate Teleport target with selector "${targetSelector}". ` +
|
||||
`Note the target element must exist before the component is mounted - ` +
|
||||
`i.e. the target cannot be rendered by the component itself, and ` +
|
||||
`ideally should be outside of the entire Vue component tree.`,
|
||||
)
|
||||
}
|
||||
return target as T
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue