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

Accomodate for key being passed withing a v-bind object of props #2123

Open
RainbowGiantSquid opened this issue Apr 3, 2023 · 1 comment

Comments

@RainbowGiantSquid
Copy link

What rule do you want to change?

https://eslint.vuejs.org/rules/valid-v-for.html

Does this change cause the rule to produce more or fewer warnings?
fewer

How will the change be implemented? (New option, new default behavior, etc.)?
needs to accomodate for the key being passed in the v-bind object

Please provide some example code that this change will affect:
currently throwing a warning with missing key directive

<ComponentName v-for="item in array" v-bind="{key: item.id, anotherProp, oneMoreProp}" />

//another case:

<ComponentName v-for="(item, key) in array" v-bind="{key, anotherProp, oneMoreProp}" />

What does the rule currently do for this code?

throwing a 'require v-bind:key directive'

What will the rule do after it's changed?

Will not throw the warning when key is passed in an object with other props.

Additional context

@FloEdelmann
Copy link
Member

I think it's fine if the value of v-bind is an object literal that contains a key item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants