[Vuejs]-How do I get my images to load in Vue app using webpack and vue-loader?

0👍

I believe I had the same exact issue as you! Eventually it was a simple fix, let me know if this helps.

<template>
  <main>
    <img src="../assets/logo.png" />
  </main>
</template>

<script>
import picture from '../assets/logo.png'


export default {
  name: 'HelloWorld',
  assets: picture
  }
}
</script>

Without importing, you can still access the photo by using it as a background-image of an element

main {
  background-image: url(src="../assets/logo.png")
}

Leave a comment