Navigation Menu

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

False positive error on v-if/else keys in Vue 2.7 #1638

Closed
dsl101 opened this issue Jul 26, 2022 · 0 comments
Closed

False positive error on v-if/else keys in Vue 2.7 #1638

dsl101 opened this issue Jul 26, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@dsl101
Copy link

dsl101 commented Jul 26, 2022

I've just configured Volar + Sublimetext, and I think I've got it set up correctly for my project (Vue 2.7-based, not ts). With this kind of template code:

<template v-for="(val, key) in obj">
  <div v-if="key === 'thing'" :key="key">{{ val }}</div>
  <span v-else :key="key">{{ val }}</span>
</template>

I'm seeing this error:

image

Since it's Vue 2, I can't put the key on the template element. And since I'm reading from an object, I'm certain the keys will be unique. But I guess because it sees the same variable in the div and span, it's triggering an error, which then pops up the ST console panel every time I save.

Any advice on how to configure for this? Or where to post if it's not a Volar issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants