]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: more detailed teleport target warning
authorEvan You <yyx990803@gmail.com>
Sun, 19 Jul 2020 15:52:03 +0000 (11:52 -0400)
committerEvan You <yyx990803@gmail.com>
Sun, 19 Jul 2020 15:52:03 +0000 (11:52 -0400)
close #1629

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

index ceeb451df0ad6329054e7709eb399cb02130a8eb..a4fdd4b505fd5f157eeda92f4d04d540f1dfd4ba 100644 (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