使用:
<ImgBig v-if="scope.row['ur_review_img']" :src="scope.row['ur_review_img']" style="margin-top:7px;" />
ImgBig组件:
<template>
<!--图片放大-->
<div>
<el-tooltip placement="right" effect="light" :hide-after="NUM" :enterable="false">
<div slot="content">
<!-- <img v-lazy="src" width="350" height="350" alt="暂无图片"/> -->
<el-image :src="src" style="width:350px;height:350px">
<div slot="error" class="image-slot">
<img :src="no_img" style="width:350px;height:350px">
</div>
</el-image>
</div>
<!-- <img v-lazy="src" width="70" height="70" alt="暂无图片"/> -->
<el-image :src="src" style="width:70px;height:70px">
<div slot="error" class="image-slot">
<img :src="no_img" style="width:70px;height:70px">
</div>
</el-image>
</el-tooltip>
</div>
</template>
<script>
import no_img from '../assets/no_img.jpg'
export default {
name: 'ImgBig',
props: {
src: String
},
data() {
return {
isError: false,
NUM: 2000,
no_img
}
},
methods: {
}
}
</script>
<style scoped>
.el-tooltip__popper {
padding: 5px;
border:1px solid #ccc !important;
}
</style>