cell-image.vue
704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<template>
<div>
<a :href="productUrl" target="_blank">
<img class="cell-img" :src="src" target = "_blank">
</a>
</div>
</template>
<script>
import _ from 'lodash';
export default {
name: 'cell-image',
props: {
imageSrc: {
type: String
},
productUrl: {
type: String
}
},
data() {
return {
src: ''
};
},
created() {
this.src = _.replace(this.imageSrc, 'http:', '');
}
};
</script>
<style lang="scss" scoped>
.cell-img {
max-width: 200px;
}
</style>