📝 fix example that vue3 history not be destroyed (#1341)

Co-authored-by: Antes <tangzh@rantion.com>
This commit is contained in:
Antes 2021-03-26 17:51:48 +08:00 committed by GitHub
parent 1b150abce0
commit f7455975f6

View File

@ -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();
}