vue js link image link in props doesnt work
Step 1: Define the Prop
props: {
imageUrl: String
}
Step 2: Use the Prop in the Template
<img :src="imageUrl" alt="Image">
Step 3: Pass the Image URL as a Prop
<template>
<image-component :imageUrl="imageLink"></image-component>
</template>
<script>
import ImageComponent from './ImageComponent.vue';
export default {
components: {
ImageComponent
},
data() {
return {
imageLink: 'https://example.com/image.jpg'
};
}
};
</script>