Skip to content

Commit 04adda0

Browse files
liujupingJackLian
authored andcommitted
docs: add faq-Slot组件渲染报错问题
1 parent d64c7d5 commit 04adda0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/docs/faq/faq023.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Slot组件渲染报错问题
3+
sidebar_position: 23
4+
tags: [FAQ]
5+
---
6+
7+
## 问题描述
8+
在低代码引擎的页面渲染过程中,可能会遇到一个关于Slot组件的报错,提示“Slot找不到”。实际上,在渲染态时不应使用Slot组件。
9+
10+
## 问题原因
11+
低代码引擎渲染分为两个状态:设计态和渲染态。
12+
- **设计态**:为了帮助插槽进行可视化设计,引入了Slot组件。
13+
- **渲染态**:在此状态下,不需要使用Slot组件。
14+
15+
这个问题通常是因为在渲染态错误地使用了设计态的schema。
16+
17+
## 解决方案
18+
1. **区分设计态和渲染态**:通过`project.exportSchema(TransformStage.Save)`的参数来区分。
19+
- `TransformStage.Save`代表渲染态的schema,其中不包含Slot组件。
20+
- 【默认值】`TransformStage.Render`代表设计态的schema,其中包含Slot组件。
21+
2. **使用正确的API和参数**:确保在渲染态使用正确的schema,避免引用设计态的Slot组件。
22+
3. **处理脏数据问题**:如果问题是由脏数据导致,清除数据并重新拖拽组件以恢复正常。
23+
24+
## 注意事项
25+
- 确保在代码和配置中正确区分设计态和渲染态。
26+
- 如果遇到持续的问题,检查是否有脏数据或配置错误,并进行相应的清理和调整。
27+
28+
## 相关链接
29+
- Issue链接:[Issue #1798](https://github.com/alibaba/lowcode-engine/issues/1798)
30+
31+
---

0 commit comments

Comments
 (0)