img-size.vue
381 Bytes
<template>
<img :src="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>