I'm new to Vue. I'm trying to add an image(svg/png) to a component but I keep getting this error. I'm new to it, please keep that in consideration.
Failed to compile.
./src/components/Overview.vue?vue&type=template&id=6408adae&scoped=true& (./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"06a978e8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Overview.vue?vue&type=template&id=6408adae&scoped=true&) Module not found: Error: Can't resolve './assets/logo.png' in '/Users/kurbs/Desktop/Flaintweb2/flaintweb/src/components'
My code
<template>
<div class="hello">
<h1>Flaint</h1>
<p>Flaint allows artists to create their virtual art gallery to showcase their paintings.</p>
//Error <img src="./assets/logo.png">
</div>
</template>
<script>
export default {
name: 'Overview',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
image:require("./assets/img.jpg")
and then bind it to image tag src like<img :src='image' />
. – Mat J