V-if console reported an error

forkey

May.05,2021

it is estimated that your project uses esLint check, and there is also a vMelfort. Just add: key

<div v-for="(item, index) of items" :key="index">

after the problem is modified

  1. there is no problem with both index
  2. No problem with key

template cannot be used: key, so I think the error in the main code of the building should not be the error of the screenshot. I gave it to template: key and the following error occurred

  • < template > cannot be keyed. Place the key on real elements instead.

change it to div or template and put a layer of div in it.


look at the error message and ask you to add : key


template and other tags. You can hover to the place where the error is reported, and the error message will be displayed


the key value is repeated. In both of your loops, the table in the second cycle of index, uses the index, of the first cycle, and the key value may be undefined. It is equivalent to not binding the key value


two loops try using different ones: key, for example, the second one is changed to: key = 'key'

Menu