devicesmgt/sgzb-ui/src/views/scrapManage/component/scrapImg.vue

65 lines
1.3 KiB
Vue

<template>
<div>
<!-- <a
href="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
target="_blank"
v-for="(item, index) in scrapImgList"
:key="index"
>查看</a
> -->
<ImagePreview
v-for="(item, index) in scrapImgList"
:key="index"
:src="`${impViewUrl}${item}`"
:width="`20px`"
:height="`20px`"
class="img-box"
/>
</div>
</template>
<script>
export default {
props: {
scrapImgUrl: {
type: String,
default: () => null,
},
},
data() {
return {
scrapImgList: [],
impViewUrl: process.env.VUE_APP_BASE_API + '/system',
}
},
mounted() {
// let imgList = []
if (this.scrapImgUrl) {
this.scrapImgList = this.scrapImgUrl.split(',')
}
// this.scrapImgList = imgList.map(
// (item) => (item = this.impViewUrl + item),
// )
},
}
</script>
<style scoped>
a {
margin-right: 8px;
font-size: 13px;
color: #1890ff;
}
a:last-child {
margin: 0;
}
.img-box {
margin-right: 8px;
}
.img-box:last-child {
margin: 0;
}
</style>