alibaba/formily

[Bug Report] 在Vue2中使用@formily/element有问题

Opened this issue · 4 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?

期望能够正常展示

What is actually happening?

控制台报错,页面无法展示。

Package

@formily/element@2.2.19


怀疑是 @vue/composition-api 的问题?或者是哪个版本不兼容的问题?

上面示例的报错:

image

我项目中的报错:(我理解也是同一个问题?)
image

我在项目中将 Vue.use(VueCompositionAPI) 去掉,发现标签页可以渲染。但 JSON Schema 不能渲染。也就是这个问题

然后我看了一下源码,发现 @formily/vue 中的 ReactiveField 组件中这里的 field 是空的(直接就是 undefined),所以导致了没有渲染

image

看到是由这个组件注入的,但发现这个组件并没有执行。。。。

image

但实际中又是渲染了

image

已找到问题,是因为公司内部源没有及时同步 @formily/element 版本,导致版本不对导致。

这个问题可以 Close 了