v-for错误提示[vue-language-server] Elements in iteration expect to have 'v-bind:key' directives. Rend...

Vue 2.2.0+的版本里,当在组件中使用v-for时,key是必须设置的:



注意上面key值不要用对象或是数组作为key,用string或number作为key,否则报错:[Vue warn] Avoid using non-primitive value as key, use string/number value instead.

你可能感兴趣的:(v-for错误提示[vue-language-server] Elements in iteration expect to have 'v-bind:key' directives. Rend...)