【ElementUI】一行代码解决图片预览
只需要在图片标签上加入:preview-src-list
完整代码如下:
python
<el-table-column label="封面" align="center" prop="cover" :sort-orders="['descending','ascending']" sortable="custom">
<template slot-scope="scope">
<el-image
v-if="scope.row.cover"
style=" height: 50px"
:src="scope.row.cover"
:preview-src-list="[scope.row.cover]"
>
</el-image>
</template>
</el-table-column>