如何使用reducerrs方法来处理lightning web组件中的错误?
Can Anyone explain please why did we write ": [ ] " in line 10. I believe it is the simplest way to write but what exactly is this, can anyone give another example of this to understand please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

你需要一起看第 9 行和第 10 行。这只是一个
?:
条件运算符。如果出现错误 - 使用辅助函数(它可能会扁平化各种错误消息、页面级别、字段级别、重复规则等)来获取 1 条简单的错误消息。
否则返回一个空数组。
you need to look at lines 9 and 10 together. It's just a
?:
conditional operator.If there are errors - use helper function (it probably flattens various error messages, page level, field level, duplicate rules etc) to get 1 simple error message.
Else return an empty array.