You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use v-for sometimes for iterating using the index of an array. Normally in typescript I can use "_" to ignore the first parameter and only use the second one. Using Volar I always get an error.
<divv-for="(_, i) in ['a','b','c']">{{i}}</div>
'_' is declared but its value is never read.ts(6133)
Workarounds are:
<divv-for="(_, i) in ['a','b','c']">{{i}}</div> // Renders: 0 1 2; Leads to ts error
<divv-for="iin ['a','b','c'].length">{{i}}</div> // Renders: 1 2 3; Workaround a
<divv-for="iin [...Array(['a','b','c'].length).keys()]">{{i}}</div> // Renders: 0 1 2; Workaround b
I use v-for sometimes for iterating using the index of an array. Normally in typescript I can use "_" to ignore the first parameter and only use the second one. Using Volar I always get an error.
Workarounds are:
Old issue: johnsoncodehk/vue-tsc#59
Related problem: #329
Here the issue is, that the variable is used in :key but volar does not recognize that it is actually used
The text was updated successfully, but these errors were encountered: