img-size.vue
384 Bytes
<template>
<img v-lazy="currentSrc" :alt="alt">
</template>
<script>
export default {
name: 'ImgSize',
props: {
src: String,
width: Number,
height: Number,
alt: String
},
computed: {
currentSrc() {
return (this.src || '')
.replace('{width}', this.width)
.replace('{height}', this.height);
}
}
};
</script>
<style>
</style>