Skip to content

The child component reported an error when a parent-child parameter was passed in the request Cannot read properties of undefined #7146

Discussion options

You must be logged in to vote

playground

// bad
{{props.users[0].name}}

// 在template 无需要在写props了,然后在使用数组下标的时候要判断下标是否存在哦
{{users?.[0].name}}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Silence-dream
Comment options

Answer selected by Silence-dream
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants