mirror of https://github.com/alibaba/ice.git
fix: init default value
This commit is contained in:
parent
8a6a2e7890
commit
295e926ad5
|
@ -23,7 +23,7 @@ const runtime: RuntimePlugin = ({ getAppRouter, setAppRouter, appContext }) => {
|
||||||
const [routeInfo, setRouteInfo] = useState<RouteInfo>({});
|
const [routeInfo, setRouteInfo] = useState<RouteInfo>({});
|
||||||
const [appEnter, setAppEnter] = useState<AppConfig>({});
|
const [appEnter, setAppEnter] = useState<AppConfig>({});
|
||||||
const [appLeave, setAppLeave] = useState<AppConfig>({});
|
const [appLeave, setAppLeave] = useState<AppConfig>({});
|
||||||
const [apps, setApps] = useState<AppConfig[]>([]);
|
const [apps, setApps] = useState<AppConfig[] | null>(null);
|
||||||
const FrameworkLayout = layout || React.Fragment;
|
const FrameworkLayout = layout || React.Fragment;
|
||||||
const appInfo = {
|
const appInfo = {
|
||||||
pathname: routeInfo.pathname || (typeof window !== 'undefined' ? window.location.pathname : ''),
|
pathname: routeInfo.pathname || (typeof window !== 'undefined' ? window.location.pathname : ''),
|
||||||
|
@ -64,7 +64,7 @@ const runtime: RuntimePlugin = ({ getAppRouter, setAppRouter, appContext }) => {
|
||||||
<FrameworkLayout {...appInfo}>
|
<FrameworkLayout {...appInfo}>
|
||||||
{apps && (
|
{apps && (
|
||||||
<AppRouter {...appRouterProps}>
|
<AppRouter {...appRouterProps}>
|
||||||
{apps.map((item: AppConfig, idx: number) => (
|
{apps?.map((item: AppConfig, idx: number) => (
|
||||||
<AppRouteComponent key={idx} {...item} />
|
<AppRouteComponent key={idx} {...item} />
|
||||||
))}
|
))}
|
||||||
<AppRouteComponent
|
<AppRouteComponent
|
||||||
|
|
Loading…
Reference in New Issue