From: underfin <2218301630@qq.com> Date: Thu, 11 Jun 2020 21:20:38 +0000 (+0800) Subject: chore: better warning when remounting a mounted app (#1297) X-Git-Tag: v3.0.0-beta.15~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b934401469c9c1864bbacace8d24c309b083839;p=thirdparty%2Fvuejs%2Fcore.git chore: better warning when remounting a mounted app (#1297) --- diff --git a/packages/runtime-core/src/apiCreateApp.ts b/packages/runtime-core/src/apiCreateApp.ts index 4e3079e436..8c0db0412e 100644 --- a/packages/runtime-core/src/apiCreateApp.ts +++ b/packages/runtime-core/src/apiCreateApp.ts @@ -225,7 +225,10 @@ export function createAppAPI( 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)\`` ) } },