vue3 element-plus
el-table-column使用v-for展示数据,针对展示需要处理的数据使用平常的<template #defalut="scope">
不生效。
可以改成用v-slot
<el-table-column
v-for="item in tableColumn"
:key="item"
:prop="item.prop"
:label="item.label"
:sortable="item.isSort"
show-overflow-tooltip
:width="item.width"
>
<template v-slot="scope">
<span v-if="item.prop == 'modifyTime'">{{
scope.row[`${item.prop}`].substring(0, 10)
}}</span>
<span v-else>{{ scope.row[`${item.prop}`] }}</span>
</template>
</el-table-column>