chore: more detailed teleport target warning

close #1629
This commit is contained in:
Evan You 2020-07-19 11:52:03 -04:00
parent f9826fa963
commit b3af5dbe5d

View File

@ -41,7 +41,10 @@ const resolveTarget = <T = RendererElement>(
if (!target) {
__DEV__ &&
warn(
`Failed to locate Teleport target with selector "${targetSelector}".`
`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 any