0👍
Although your question ain’t constructive enough but I think I understand what youre trying to do.
To pass image as props to a child component, you need to import it in the Parent component script, then you can bind to it by passing it as props to the child component in the parent’s template:
// PARENT COMPONENT
<template>
<div>
<ChildComponent
:logo="logoObject"
/>
</div>
</template>
<script>
import ChildComponent from '../<point to child component here>'
import logo from '../../asset/<point to image here>'
export default(){
data(){
logoObject: logo
}
}
</script>
// CHILD COMPONENT
<template>
<div>
<img :src="logo" />
</div>
</template>
<script>
export default(){
props: ['logo']
}
</script>
- [Vuejs]-How to add variables in vue and use them as a code editor?
- [Vuejs]-How to pass the data variable in geturldata in vuejs in html part not any one is the same
Source:stackexchange.com