vue2和vue3 template v-for key的位置
报错‘<template v-for>‘ cannot be keyed. Place the key on real elements instead
vue2:<template> 标签不能拥有 key
<template v-for="i in list"> <div :key="'index-' + i.id"></div> </template>
vue3:key 则应该被设置在 <template> 标签上
<template v-for="(i, index) in list" :key="index"> <div>...</div> <span>...</span> </template>

浙公网安备 33010602011771号