v-for sets the key value key

Always use key with v-for. A key must always be used with v-for on a component in order to maintain the state of the internal component and its subtrees.

<ul>
  <li
    v-for="todo in todos"
    :key="todo.id"
  >
    {{ all.text }}
  </li>
</ul>

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324668783&siteId=291194637