【问题标题】:Spline Animation disappears when deploying展开时样条动画消失
【发布时间】:2022-10-19 21:04:53
【问题描述】:

当我使用 Spline 在本地运行应用程序时,我使用 Spline 进行了 3D 设计并添加到了我的应用程序中npm 运行构建它完美地工作我可以看到设计和一切。但是,当我尝试在 Internet 上部署应用程序时,Spline 设计将消失我不明白为什么会发生这种情况,我已将应用程序部署到 Vercel、Firebase 和 Heroku。我的应用程序是一个带有 Node.js 的 React 应用程序。

 <div className="relative" id="home">
        <Spline scene="https://prod.spline.design/0TUuMfCgXS3Xkkuo/scene.splinecode" />
          <div className="absolute bottom-10 w-full flex justify-center items-center">
            <div className="shadow-md p-4 flex items-center justify-center bg-zinc-900 rounded-3xl ">
              <p className="text-white">Press and drag to orbit</p>
            </div>
          </div>
        </div>

【问题讨论】:

    标签: node.js reactjs hosting spline


    【解决方案1】:

    它适用于没有服务器端渲染的 iFrame。您必须将其包装在组件中。您可以从“下一个/动态”导入具有动态的组件:

    const IFrameComponent = dynamic(() => import('path/to/component'), {
      ssr: false,
    })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-24
      • 2011-12-13
      • 2010-09-23
      • 2019-08-20
      • 2015-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多