Based on vue, vuev-for solves the problem of using v-for with red and warning.
The Code reported red is uncomfortable for patients with obsessive-compulsive disorder pursuing beautiful code. The red is as follows:
In the console, there will also be:
(Emitted value instead of an instance of Error) <Option v-for = "item in searchTypeList">: component lists rendered with v-for shoshould have explicit keys. see https://vuejs.org/guide/list.html#key for more info.
This prompt solves the problem of red. We need to add a unique key during the loop according to his prompt. Here we choose to use index:
<Ul class = "clearfix course-list"> <li class = "left" v-for = "(item, index) in gradeClassfy. primary. grade ": key =" index "> <ahref =" # "rel =" external nofollow "> {item. name }}</a> </li> </ul>
In this case, the red message disappears.
The above section solves the problem of using v-for in vue and prompts a warning. It is all the content that I have shared with you. I hope to give you a reference, we also hope that you can support the customer's home.