使用 <MicroApp /> 组件的方式加载子应用,页面无法渲染 #12292
pengyandong
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@umijs/plugin-qiankun 的版本^2.44.1 (主应用跟子应用是同一个版本)
umi的版本^3.5.0"
主应用配置
qiankun: {
master: {
// 注册子应用信息
apps: [
{
name: 'myapp', // 唯一 id
entry: '//localhost:8001',
},
],
},
},
路由配置
{
path: '/templete',
name: 'templete',
routes: [
{
path: '/templete/Demo',
name: '模版',
component: './templete/Demo',
},
],
},
import { MicroApp } from 'umi';
const Demo: React.FC = () => {
return (
<MicroApp
name="myapp" // 子应用的名称
autoSetLoading={true} // 是否自动设置 loading 状态
base="/templete/Demo"
/>
);
};
http://172.20.54.79/enclosure/2024/4/16/7765dedb-43fb-49c8-8f95-c68ac2a627af.jpg
http://172.20.54.79/enclosure/2024/4/16/98b38ed0-7afd-4239-8010-2bae0cada36c.jpg
Beta Was this translation helpful? Give feedback.
All reactions