aliyun / alibabacloud-alfa

阿里云微前端解决方案
https://aliyun.github.io/alibabacloud-alfa
MIT License
846 stars 83 forks source link

添加针对 React 的默认路由处理 #74

Closed Boelroy closed 3 years ago

Boelroy commented 3 years ago

针对宿主提供了 React 针对默认路由处理的同步逻辑

import Application,  { withDefaultRouterHandler } from  '@alicloud/console-os-react-app';

const App = withDefaultRouterHandler(Application);

<App 
  history={history} // react router 的 history
/>

并且在子应用中提供了 data-alfa-external-router 的属性来作为不属于子应用中链接,通知宿主做跳转

<a data-alfa-external-router  href="/xxx"/>