Closed Akryum closed 7 years ago
Thank you for the report.
However, I think this is intentional.
We have two rules about the key
attribute.
key
attribute but don't have. This rule is in order to prevent errors.key
attribute. This rule is in order to follow the recommendation of Vue.js team.Thanks for your answer! Slots are like templates abstract, they can't have a key. You will also get an error from Vue if a key is set on a <slot/>
. So this is still a bug, since eslint-plugin-vue will complain about <slot/>
not having a key, and then Vue won't compile your template since you have put a key on the slot (which is forbidden).
Oh, I see. Indeed, require-v-for-key
has an exception for <template>
elements because it isn't rendered. If <slot>
also isn't rendered, require-v-for-key
rule should not report <slot>
elements as well.
Tell us about your environment
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
No error.
What actually happened? Please include the actual, raw output from ESLint.