大佬教程收集整理的这篇文章主要介绍了单个 SPA JSON 布局定义,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在我的特定用例中,我需要动态加载导入和路由,为此我需要实现模板引擎的 Json 方法。根据文档实施时,我收到一个空白屏幕。这个 root-config 是从 github repo 中提取的。
react-mf-root-config.Js
const routes = constructroutes({
routes: [
{
type: "route",path: "planets",routes: [{ type: "application",name: "@react-mf/planets" }],},],});
const applications = constructApplications({
routes,loadApp: ({ name }) => System.import(Name),});
applications.forEach(registerapplication);
start();
index.eJs
<script
type="systemJs-importmap"
src="https://storage.GoogleAPIs.com/react.microfrontends.app/importmap.Json"
></script>
<% if (isLocal) { %>
<script type="systemJs-importmap">
{
"imports": {
"@react-mf/root-config": "//localhost:9000/react-mf-root-config.Js"
}
}
</script>
<% } %>
<script src="https://cdn.Jsdelivr.net/npm/import-map-overrIDes@2.2.0/dist/import-map-overrIDes.Js">
</script>
<script src="https://cdn.Jsdelivr.net/npm/systemJs@6.8.3/dist/system.min.Js"></script>
<script src="https://cdn.Jsdelivr.net/npm/systemJs@6.8.3/dist/extras/amd.min.Js"></script>
<template ID="single-spa-layout">
<single-spa-router> </single-spa-router>
</template>
</head>
<body>
<script>
System.import("@react-mf/root-config");
System.import("@react-mf/styleguIDe");
</script>
...
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的单个 SPA JSON 布局定义全部内容,希望文章能够帮你解决单个 SPA JSON 布局定义所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。