alibaba/formily

[Bug Report] form.getFormGraph 返回值问题

purple-force opened this issue · 2 comments

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

直接运行

What is expected?

form.getFormGraph() 能够给出所有字段的 state
Object.keys(form.fields) 能够给出所有字段

What is actually happening?

form.getFormGraph() 只有顶层的 form 的 state
Object.keys(form.fields) 为空数组

Package

@formily/core@2.3.1


渲染时执行拿出来的结果,对应的 field 都没初始化完成,没拿到是符合预期的。完成渲染后再拿就符合预期了
image
image

有什么使用场景是直接在渲染时拿到这些数据吗?

渲染时执行拿出来的结果,对应的 field 都没初始化完成,没拿到是符合预期的。完成渲染后再拿就符合预期了 image image

有什么使用场景是直接在渲染时拿到这些数据吗?

那倒没有。看来是我使用的问题,多谢解答。