New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
子应用 Ant design message 组件样式丢失 #1204
Comments
Modal, Drawer, Notification, Tooltip 等弹出式组件均正常展示。 |
Hello @yiluzhang. In order to facilitate location and troubleshooting, we need you to provide a realistic GitHub repository. |
问题出在路由系统非 pure 模式时,子应用独自进行了路由跳转,导致 message 组件可能不显示 主应用import Vue from 'vue'
import App from './App.vue'
import microApp from "@micro-zoe/micro-app";
microApp.start();
new Vue({
render: h => h(App),
}).$mount('#app') // App.vue
<template>
<micro-app iframe name="subsys" url="http://localhost:5173/subsys" />
</template> 子应用import React, { useEffect } from 'react';
import ReactDOM from 'react-dom/client';
import { ConfigProvider, message } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import { Outlet, RouterProvider, createBrowserRouter, useNavigate } from 'react-router-dom';
let root: ReactDOM.Root;
function Page() {
useEffect(() => {
setTimeout(() => message.info('tip..'), 10);
}, []);
return <h3>刷新看看</h3>;
}
function Root() {
const navigate = useNavigate();
useEffect(() => {
navigate('/subsys/page');
}, []);
return (
<ConfigProvider locale={zhCN}>
<Outlet />
</ConfigProvider>
);
}
const router = createBrowserRouter([
{
path: '/subsys',
element: <Root />,
children: [
{
path: 'page',
element: <Page />,
},
],
},
]);
function mount() {
root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>,
);
}
if (window.__MICRO_APP_ENVIRONMENT__) {
window[`micro-app-${window.__MICRO_APP_NAME__}`] = { mount, unmount: () => root.unmount() };
} else {
mount();
} |
Since the issue was labeled with |
@bailicangdu 问题被自动关闭,请问我提供的复现代码无法复现问题吗? |
问题描述
子应用 ant design message 组件样式丢失无法,正常显示。
上传截图
环境信息
The text was updated successfully, but these errors were encountered: