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

Got "valid-v-for" if I write key in bind attribute #1493

Closed
3 tasks done
iigmir opened this issue Nov 8, 2019 · 3 comments
Closed
3 tasks done

Got "valid-v-for" if I write key in bind attribute #1493

iigmir opened this issue Nov 8, 2019 · 3 comments
Labels

Comments

@iigmir
Copy link

iigmir commented Nov 8, 2019

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: macOS 10.15.1
  • Vetur version: 0.22.6
  • VS Code version: 1.40.0

Problem

When I write codes like "Reproducible Case" paragraph, it shows this linting:

[vue/valid-v-for]
Custom elements in iteration require 'v-bind:key' directives.eslint-plugin-vue

Screenshot

Binding an object of attributes is valid syntax in VueJS. I believe that write the key attribute in the v-bind binding object should be valid.

Reproducible Case

Save this code in VS Code as .vue format:

<template>
    <b-nav-item v-for="(item) in link_binding" v-bind="{ key: item.name.id }" >
        Elements inside
    </b-nav-item>
</template>

Issues might be related

#261

Replace require-v-for-key with new rule just for stateful elements #522

@sqal
Copy link

sqal commented Nov 8, 2019

You should report this issue in the eslint-plugin-vue repository, this is not directly related to Vetur.

@ktsn ktsn added the upstream label Nov 9, 2019
@ktsn
Copy link
Member

ktsn commented Nov 9, 2019

Yes, it should be reported on eslint-plugin-vue.

@ktsn ktsn closed this as completed Nov 9, 2019
@iigmir
Copy link
Author

iigmir commented Nov 9, 2019

OK, I will. I just thaught that it's just a issue from Vetur.

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

No branches or pull requests

3 participants