alibaba / lowcode-engine

An enterprise-class low-code technology stack with scale-out design / 一套面向扩展设计的企业级低代码技术体系
https://lowcode-engine.cn
MIT License
14.58k stars 2.53k forks source link

数据源 willFetch 没有执行 #319

Closed twinkle77 closed 2 years ago

twinkle77 commented 2 years ago

Describe the bug (required) / 详细描述 bug(必填)

image

看了下代码,原因是: ReactRenderer 没有传 appHelper

image

更改如下就可以了:

image

问题: 为什么 ReactRenderer 默认不是走 lowcode-datasource-engine 的逻辑

github-actions[bot] commented 2 years ago

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.

xingmolu commented 2 years ago

嗨,请问下是否在设计态的时候请求没有执行willFetch吗?还是说预览态哈

xingmolu commented 2 years ago

请根据文档设置设计态开启数据源引擎 https://www.yuque.com/lce/usage/datasource#xo5DC

sundi78634 commented 2 years ago

@xingmolu 看文档是如何定制fetch的,shouldFetch 和 willFetch没有调用不是这个原因吧? engine dataHelper中只有dataHandler的处理,没有其他钩子的。

xingmolu commented 2 years ago

@sundi78634 代码里有的,https://github.com/alibaba/lowcode-datasource/blob/main/packages/datasource-engine/src/core/RuntimeDataSourceItem.ts#L92

你是在设计态的情况下没有触发吧?

sundi78634 commented 2 years ago

@xingmolu 原来在这里处理,多谢。 设计态是指在editor中吗?编辑和预览都没有调用。

xingmolu commented 2 years ago

@sundi78634 设计态是指editor中,编辑中没有调用,需要按照文档手动启用下数据源引擎(后面demo中我们加上这个);预览没调用,麻烦给个demo看下;

sundi78634 commented 2 years ago

@xingmolu lowcode-demomain分支npm run start可复现,注意demo本地启动为http服务,请求https url有跨域问题。 在线demo后边有时间补上。