服务器渲染(SSR)单个水疗中心

发布于 2025-02-11 01:37:00 字数 1699 浏览 1 评论 0原文

我在单个SPA应用程序中的布局(routes.html)下面有

<single-spa-router>
    <redirect from="/" to="/home"></redirect>
  
    <div id="wrapper">
      <div class="wrapper-content">
        <div class="layout-content">
          <application name="@ppbet/layout-app"></application>
        </div>
        <div class="main-content">
          <div class="layout-left-content">
            <application name="@ppbet/layout-left"></application>
          </div>
          <div class="center-content">
            <route path="home" exact>
              <application name="@ppbet/home-app"></application>
            </route>
            <div class="main-content-custom">
              <footer>
                <!-- I want this Application to be rendered on Server side -->
                <application name="@ppbet/footer"></application>
              </footer>
            </div>
          </div>
          <div class="layout-right-content">
            <application name="@ppbet/layout-right"></application>
          </div>
        </div>
      </div>
    </div>
  </single-spa-router>

我希望在应用程序加载时呈现服务器的页面应用程序(React组件)。

我已经阅读了 ssr in Single Spa 看起来像这样呈现整个应用程序在服务器端和客户端的其余应用程序。我什至尝试使用 single-spa-html 但是我看到这不会在服务器端渲染我的HTML。任何帮助将不胜感激。

I have below Layout (routes.html) in my Single SPA Application

<single-spa-router>
    <redirect from="/" to="/home"></redirect>
  
    <div id="wrapper">
      <div class="wrapper-content">
        <div class="layout-content">
          <application name="@ppbet/layout-app"></application>
        </div>
        <div class="main-content">
          <div class="layout-left-content">
            <application name="@ppbet/layout-left"></application>
          </div>
          <div class="center-content">
            <route path="home" exact>
              <application name="@ppbet/home-app"></application>
            </route>
            <div class="main-content-custom">
              <footer>
                <!-- I want this Application to be rendered on Server side -->
                <application name="@ppbet/footer"></application>
              </footer>
            </div>
          </div>
          <div class="layout-right-content">
            <application name="@ppbet/layout-right"></application>
          </div>
        </div>
      </div>
    </div>
  </single-spa-router>

I want the footer Application(A React Component) to be Server Render at the time of load of application.

I have read through SSR in Single SPA Looks like this to render a whole application on server side and rest of applications on client side. I even tried to use single-spa-html, But i see this will not render my HTML on Server side. Any help will be Appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文