Vue is not under an element package, how to write key

<ul>
  <template v-for="item in items">
    <li>{{ item.msg }}</li>
    <li class="divider" role="presentation"></li>
  </template>
</ul>

like this

Nov.26,2021

<ul>
    <template v-for="item in items">
        <li :key="item.id+1">{{ item.msg }}</li>
        <li :key="item.id+2" class="divider" role="presentation"></li>
    </template>
</ul>

The function of

key is to distinguish elements and cannot be placed on template. The values of key can be spliced according to the requirements, so use

flexibly.
<template v-for="item in items">
    <li :key="item.id + '-1'">{{ item.msg }}</li>
    <li :key="item.id + '-2'" class="divider" role="presentation"></li>
</template>

</li>
</template>
Menu