[ElementUI] One line of code solves picture preview

[ElementUI] One line of code solves picture preview

Insert image description here
Insert image description here

Just add it to the image tag:preview-src-list

  The complete code is as follows:

<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>

Guess you like

Origin blog.csdn.net/qq_43592352/article/details/134790406