alibaba / x-render

🚴‍♀️ 阿里 - 很易用的中后台「表单 / 表格 / 图表」解决方案
https://xrender.fun
6.98k stars 989 forks source link

beforeFinish执行通过没办法执行到onFinish #1379

Closed jackqiu0123 closed 1 year ago

jackqiu0123 commented 1 year ago

1.依赖仓库的版本(Dependencies versions)

2.问题描述(Bug description)

beforeFinish方法返回的是Error[]或者Promise<Error[]>

如果我校验beforeFinish通过的话,没办法直接返回null来执行onFinish

image

lhbxs commented 1 year ago

感觉你使用的有点问题,你看看这个 https://xrender.fun/form-render/advaced-example#%E8%A1%A8%E5%8D%95%E6%9C%8D%E5%8A%A1%E7%AB%AF%E6%A0%A1%E9%AA%8C

jackqiu0123 commented 1 year ago

感觉你使用的有点问题,你看看这个 https://xrender.fun/form-render/advaced-example#%E8%A1%A8%E5%8D%95%E6%9C%8D%E5%8A%A1%E7%AB%AF%E6%A0%A1%E9%AA%8C

@lhbxs 那如果我校验没有问题,我应该返回什么呢 按照你给的例子,我认为应该返回的是一个空数据。 例如:return [] 或者 return [{ name: 'select', errors: [] }] 那在执行完成之后,判断filedsError的时候,不就直接走进了我划红圈的部分,那后面的onFinish该怎么执行呢。毕竟我校验的时候,已经通过了