2.5.7
https://jsfiddle.net/j9ahLed9/
Check console logs
I expect Vue to compile the above template without error
I get an error:
- invalid v-for alias "{ id, label }" in expression: v-for="{ id, label } in items"
`
v-for="({name, value}) of list"
still get an error in 2.5.8
- invalid v-for alias "{name" in expression: v-for="({name, value}) of list"
- invalid v-for iterator "value}" in expression: v-for="({name, value}) of list"
Correct:
v-for="({name, value}) of list" throws the error -> https://jsfiddle.net/fok69xvz/
but works with index parameter -> https://jsfiddle.net/fok69xvz/1/
@sqal
Sometimes I just want to add or remove index easily.
v-for="({name, value}) of list" works fine before 2.5.6
2.4.3
https://jsfiddle.net/fok69xvz/2/
2.5.6
https://jsfiddle.net/fok69xvz/3/
@mirari fixed in aa8262540ac0115d56b53863302b9f8e69f8a03d
@yyx990803 There's still one case when it still does not work correctly -> array destructuring. Example using latest Vue 2.5.9 https://jsfiddle.net/bc1r9295/. Actually i found it reading https://github.com/vuejs/vue-loader/issues/1062 And in 2.5.6 first two examples works fine, but the third one with index argument gives SyntaxError: Unexpected token error
Most helpful comment
@mirari fixed in aa8262540ac0115d56b53863302b9f8e69f8a03d