<template>
<div>
...
<el-image class="table-image" :src="imgSrc" :preview-src-list="previewSrcList(imgSrc)" />
</div>
</template>
<script>
export default {
name: 'App',
data(){
return{
...
imgSrc: 'https://xxx.com/historyImage/LC0CE6CD9N1022327-1-20220424105832-1.jpg'
}
},
methods: {
...
// 背景图片
previewSrcList(url) {
var list = []
list.push(url)
return list
}
}
}
</script>
<style scoped>
...
.table-image{
width: 30px;
height: 40px;
background-size: contain;
background-repeat: no-repeat;
}
</style>
ElementUI预览图片
于 2022-04-24 13:55:53 首次发布