cell-sku-image.vue 751 Bytes
<template>
    <div>
        <a :href="productUrl" target="_blank">
            <img class="cell-img"
                 :src="skuImageSrc">
        </a>
    </div>
</template>

<script>
    export default {
        name: 'CellSkuImage',
        props: {
            productSku: {
                type: [String, Number]
            }
        },
        data() {
            return {
                productUrl: '',
                skuImageSrc: ''
            };
        },
        created() {
            this.skuImageSrc =
            `http://shops.yohobuy.com/platform/product/getRemoteImageUrlBySku?sku_id=${this.productSku}&size=80x80`;
        }
    };
</script>

<style lang="scss" scoped>
    .cell-img {
        max-width: 200px;
    }
</style>