报错信息如下:
原代码:
<span v-for="(item,index) in blankTitle" :key="index">
<span>{{item}}</span>
</span>
<span v-for="(resultItem,resultIndex) in resultData" :key="resultIndex">
<span>{{resultItem}}</span>
</span>
如此会造成key值不唯一。
修改后代码:
<span v-for="(item,index) in blankTitle" :key="index">
<span>{{item}}</span>
</span>
<span v-for="(resultItem,resultIndex) in resultData" :key="resultIndex+100">
<span>{{resultItem}}</span>
</span>
根据情况将两个key值加以区分即可。