-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: 支持nuxt3.0 ssr模式 #1683
Comments
因为 LogicFLow 渲染是需要 DOM 元素的,所以建议是 LogicFLow 容器组件设置为 'use client',或者尝试看用下面方法解决一下 next.js 项目中,使用页面路由时,会触发 window is not defined 的报错;使用应用路由 + 组件配置 use client 时,则没有这个问题
|
不得行,bug #1668,说要设置ssr=false才能正常使用,也就是说目前就不支持ssr=true的模式,您给的解决方案就无法实现,麻烦再内部沟通下,看看如何处理,谢谢。 |
在使用前端视图库(如 Chart.js、D3.js、Three.js 等)时,通常需要一个 DOM 元素进行初始化。为了支持服务端渲染(SSR),需要确保这些库的代码只在客户端执行,因为在服务器端没有 DOM。 我们的 LogicFlow 也是类似,必须依赖 dom 元素,我们这边不需要做任何处理。只需要用户侧通过一些方式去支持服务端渲染正常工作。 参考方法:
<template>
<div>
<canvas ref="chart"></canvas>
</div>
</template>
<script>
export default {
mounted() {
if (process.client) {
// 初始化 LogicFlow 的代码
}
}
}
</script>
|
背景&目的
项目使用的是nuxt3.0 开启的是ssr=true模式。希望logicflow能够支持这种模式。
The text was updated successfully, but these errors were encountered: