Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(useAssociationNames): undefined mode in useAssociationNames #1950

Merged
merged 1 commit into from
May 29, 2023

Conversation

katherinehhh
Copy link
Contributor

Description (Bug 描述)

Steps to reproduce (复现步骤)

表格中添加bulk edit -> Form-> 添加关系字段

Expected behavior (预期行为)

正常使用

Actual behavior (实际行为)

报错,cant not read properties of undefined (read mode)

Related issues (相关 issue)

Reason (原因)

schema的‘x-compoent-props'不一定有mode属性

Solution (解决方案)

schema['x-component-props'].?mode==='Nester'
使用可选链操作符(Optional Chaining Operator)?.。这样,如果 mode 存在,表达式将返回 mode 的值;如果 mode 不存在,则整个表达式的结果为 undefined。

@katherinehhh katherinehhh merged commit 76ddbf2 into main May 29, 2023
4 checks passed
aotemj pushed a commit to aotemj/nocobase that referenced this pull request May 29, 2023
@chenos chenos deleted the fix/useAssociationNames branch August 10, 2023 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant