]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: better warning when remounting a mounted app (#1297)
authorunderfin <2218301630@qq.com>
Thu, 11 Jun 2020 21:20:38 +0000 (05:20 +0800)
committerGitHub <noreply@github.com>
Thu, 11 Jun 2020 21:20:38 +0000 (17:20 -0400)
packages/runtime-core/src/apiCreateApp.ts

index 4e3079e436f3dd3a304a923850c4ae53ab9691f5..8c0db0412e7b5ca4587f50d085e03e59c6966adb 100644 (file)
@@ -225,7 +225,10 @@ export function createAppAPI<HostElement>(
           return vnode.component!.proxy
         } else if (__DEV__) {
           warn(
-            `App has already been mounted. Create a new app instance instead.`
+            `App has already been mounted.\n` +
+              `If you want to remount the same app, move your app creation logic ` +
+              `into a factory function and create fresh app instances for each ` +
+              `mount - e.g. \`const createMyApp = () => createApp(App)\``
           )
         }
       },