Skip to content

Commit b3af5db

Browse files
committed
chore: more detailed teleport target warning
close #1629
1 parent f9826fa commit b3af5db

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/runtime-core/src/components/Teleport.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ const resolveTarget = <T = RendererElement>(
4141
if (!target) {
4242
__DEV__ &&
4343
warn(
44-
`Failed to locate Teleport target with selector "${targetSelector}".`
44+
`Failed to locate Teleport target with selector "${targetSelector}". ` +
45+
`Note the target element must exist before the component is mounted - ` +
46+
`i.e. the target cannot be rendered by the component itself, and ` +
47+
`ideally should be outside of the entire Vue component tree.`
4548
)
4649
}
4750
return target as any

0 commit comments

Comments
 (0)