共计 2087 个字符,预计需要花费 6 分钟才能阅读完成。
如下图所示,编辑器报错,但是前端能正常运行。
VUE 中是简单这样示例的,但是实际上应该加上:key
1
2
3
|
<div v–for=“item in items”>
{{ item.text }}
</div>
|
加上之后,上面的代码变成
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<el–table–column prop=“financial_money_received” width=“120” align=“center” sortable label=“ 实收金额 ”>
<template #default=”scope”>
<el–popover effect=“light” trigger=“hover” placement=“top” width=“auto”>
<template #default>
<div v–if=“scope.row.temp_financial_money_received ==null”>
查无记录
</div>
<div v–else–if=“scope.row.temp_financial_money_received.length === 0”>
查无记录
</div>
<div v–else>
<div v–for=“(item,index) in scope.row.temp_financial_money_received” :key=“index”>
{{ item.date }}
</div>
</div>
</template>
<template #reference>
<el–tag>{{ scope.row.financial_money_receivable }}</el–tag>
</template>
</el–popover>
</template>
</el–table–column>
|
因为的元素中,并没有 KEY 字段,所以要引用一个索引作为 KEY,当然,如果你有 KEY,直接以对应 KEY 即可。
正文完