lowcode-engine
lowcode-engine copied to clipboard
页面编辑器( designer ) 里面的保存Schema后点返回上一步 报错, Cannot read properties of null (reading 'componentMeta')
Describe the bug (required) / 详细描述 bug(必填)
页面编辑器( designer ) 里面的保存Schema后点返回上一步 报错, Cannot read properties of null (reading 'componentMeta')
To Reproduce (required) / 如何复现 bug?(必填,非常重要)
https://lowcode-engine.cn/demo/index.html
- 在线上Demo里 随便拖几个组件进来
- 打开Schema,点击保存Schema
- 点击 编辑器顶部的 返回上一步
- 并没有按照操作意愿返回了上一步操作,而是报错了
报错信息如下
TypeError: Cannot read properties of null (reading 'componentMeta')
at N (modal-nodes-manager.ts:7:12)
at e (modal-nodes-manager.ts:125:19)
at new e (modal-nodes-manager.ts:34:10)
at document-model.ts:372:32
at L (control.ts:21:3)
at e (document-model.ts:365:5)
at Yt (mobx.esm.js:1255:15)
at e.import (mobx.esm.js:1239:12)
at e.redoer (document-model.ts:143:14)
at e (history.ts:99:12)
Expected behavior (required) / 预期行为(必填,非常重要)
A clear and concise description of what did you expect to happen. / 请清晰和精确的描述你预期的行为
Screenshots (optional) / bug 截图(可选)
Sceenshots for further information. (If applicable.) / 一些有用的截图将会帮助我们更好的明确以及定位问题
Environments (please complete the following information) (required): / 请提供如下信息(必填)
- AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本
- AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本
- Browser [e.g. chrome, safari] / 浏览器版本
- materials / plugins / tools / 其他物料 / 插件 / 工具链版本
(this information can be collected via the manual plugin / 版本信息可通过低代码用户手册插件收集)
Additional context (optional) / 更多额外信息(可选)
Any other context of the problem here. / 可以追加更多的额外信息,帮助定位问题
测试了下,没有报错。。。虽然 undo / redo 不符合预期,把你的具体步骤再写一下?
第2步 保存Schema 很关键
- 在线上Demo里 拖入一个组件,比如标题
- 左下角...打开Schema,点击保存Schema
- 点击 编辑器顶部的 返回上一步,报错了
复现了~
目前处理成点击回退不再报错,但是无法达到回退的效果,因为「保存 Schema」相当于重新加载了一个新的 Schema,之前的操作记录已经被复位了,是否符合预期?
@LeoYuan 不仅仅是保存Schema会报错,保存源码、修改数据源之后都会报错或者失效,这两个应该是操作比较频繁的。 是否可以在Schema修改之后 回退到上一个Schema
没看懂。。。 尝试修改数据源,没遇到什么问题
@LeoYuan 就是把第二步换成 修改数据源或者保存源码,然后回退 会遇到相同的问题,导致redo、undo 报错及失效。
This issue is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 2 days.
还是有问题,希望能解决,要不然redo、undo功能就失去了作用。
通过 project.importSchema 是直接将 schema 全部重置,相当于初始化项目,丢失了操作记录。
解决方案:可以通过 project.currentDocument.importSchema,相当于往操作记录栈里推入一次操作,此时需要调用 project.simulatorHost.rerender() 刷新画布~
几个插件要作相应修改,提个 PR?
This issue is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 2 days.
This issue was closed because it has been stalled for 10 days with no activity.