From 081bddc8266204d5cbeb012cdc9f207ab55ea6bb Mon Sep 17 00:00:00 2001 From: winixt Date: Mon, 10 Oct 2022 15:30:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20qiankun=20props=20=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/micro/runtime/lifecycles.tpl | 2 +- packages/fes-runtime/types.d.ts | 36 ++++++++++--------- packages/fes-template-vite/.fes.js | 3 +- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/fes-plugin-qiankun/src/micro/runtime/lifecycles.tpl b/packages/fes-plugin-qiankun/src/micro/runtime/lifecycles.tpl index a12e9b525..20c86e23c 100644 --- a/packages/fes-plugin-qiankun/src/micro/runtime/lifecycles.tpl +++ b/packages/fes-plugin-qiankun/src/micro/runtime/lifecycles.tpl @@ -94,7 +94,7 @@ export function genMount(mountElementId) { } hasMountedAtLeastOnce = true; cacheAppPromise.then((app)=>{ - if(!cache[props.name]) { + if(props?.name && !cache[props.name]) { cache[props.name] = app; } }) diff --git a/packages/fes-runtime/types.d.ts b/packages/fes-runtime/types.d.ts index 4c906b336..7bca9d0e2 100644 --- a/packages/fes-runtime/types.d.ts +++ b/packages/fes-runtime/types.d.ts @@ -1,19 +1,21 @@ +export { Plugin } from './es/index' +export { + useRoute, + useRouter, + onBeforeRouteUpdate, + onBeforeRouteLeave, + RouterLink, + RouterView, + useLink, + createWebHashHistory, + createWebHistory, + createMemoryHistory, + createRouter, +} from 'vue-router'; -declare module "@fesjs/fes" { - export { - useRoute, - useRouter, - onBeforeRouteUpdate, - onBeforeRouteLeave, - RouterLink, - RouterView, - useLink, - createWebHashHistory, - createWebHistory, - createMemoryHistory, - createRouter, - } from 'vue-router'; - - export { default as Plugin, ApplyPluginsType } from './plugin'; -} +export interface ApplyPluginsType { + compose: 'compose', + event: 'event', + modify: 'modify' +}; diff --git a/packages/fes-template-vite/.fes.js b/packages/fes-template-vite/.fes.js index 42a973349..e1c741b0b 100644 --- a/packages/fes-template-vite/.fes.js +++ b/packages/fes-template-vite/.fes.js @@ -33,6 +33,7 @@ export default { menus: [ { name: 'index', + icon: '/wine-outline.svg', match: ['/route/*'] }, @@ -69,7 +70,7 @@ export default { ] }, locale: { - legacy: true + legacy: false }, enums: { status: [