We know that the basic use of v-for is v-for="item in list" or v-for="item of list" for traversal. This article mainly introduces how to solve the alarm problem when using v-for in the vue component. In the article, I introduce the v for command to everyone. Friends who need it can refer to it. I hope it can help everyone.
When running the v-for code snippet in the project,
{{role.value}} 出现告警:component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info. {{role.value}}
Solution:
Bind the key value in the code, which can be solved, such as:
{{role.value}}
PS: Vue2 study notes :v-for command
1.Use
Result:
Summary
Regarding solving the alarm problem when using v-for in the vue component, I hope it will be helpful to everyone It's helpful. If you have any questions, please leave me a message and I will reply to you in time!
Related recommendations:
Vue.js Common Instructions - Tutorial on Looping the v-for Instruction
vue.js Instruction v-for Usage and index acquisition
Vue.js common instructions summary (v-if, v-for, etc.)
The above is the detailed content of Introduction to the v for command in the vue component and analysis of alarm problems when using v-for. For more information, please follow other related articles on the PHP Chinese website!