📝 fix example that vue3 history not be destroyed (#1341)
Co-authored-by: Antes <tangzh@rantion.com>
This commit is contained in:
parent
1b150abce0
commit
f7455975f6
|
|
@ -7,11 +7,14 @@ import store from './store';
|
||||||
|
|
||||||
let router = null;
|
let router = null;
|
||||||
let instance = null;
|
let instance = null;
|
||||||
|
let history = null;
|
||||||
|
|
||||||
|
|
||||||
function render(props = {}) {
|
function render(props = {}) {
|
||||||
const { container } = props;
|
const { container } = props;
|
||||||
|
history = createWebHistory(window.__POWERED_BY_QIANKUN__ ? '/vue3' : '/');
|
||||||
router = createRouter({
|
router = createRouter({
|
||||||
history: createWebHistory(window.__POWERED_BY_QIANKUN__ ? '/vue3' : '/'),
|
history,
|
||||||
routes,
|
routes,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -56,4 +59,5 @@ export async function unmount() {
|
||||||
instance._container.innerHTML = '';
|
instance._container.innerHTML = '';
|
||||||
instance = null;
|
instance = null;
|
||||||
router = null;
|
router = null;
|
||||||
|
history.destroy();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user