From f7455975f64db2e00166068591736622b75c8ec8 Mon Sep 17 00:00:00 2001 From: Antes <478760274@qq.com> Date: Fri, 26 Mar 2021 17:51:48 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20fix=20example=20that=20vue3=20hi?= =?UTF-8?q?story=20not=20be=20destroyed=20(#1341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Antes --- examples/vue3/src/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/vue3/src/main.js b/examples/vue3/src/main.js index bc54a8e..9a7d9a4 100644 --- a/examples/vue3/src/main.js +++ b/examples/vue3/src/main.js @@ -7,11 +7,14 @@ import store from './store'; let router = null; let instance = null; +let history = null; + function render(props = {}) { const { container } = props; + history = createWebHistory(window.__POWERED_BY_QIANKUN__ ? '/vue3' : '/'); router = createRouter({ - history: createWebHistory(window.__POWERED_BY_QIANKUN__ ? '/vue3' : '/'), + history, routes, }); @@ -56,4 +59,5 @@ export async function unmount() { instance._container.innerHTML = ''; instance = null; router = null; + history.destroy(); }