[Vuejs]-Why isn't my image displaying, this is my first time using vue?

3👍

move your image inside src/assets then use the image.

<img alt="Vue logo" src="@/assets/jawnfinder-logo.png">

or

<b-img src="@/assets/jawnfinder-logo.png"></b-img>

Note: All the files including components,css and image should be inside src folder.

0👍

You can always import as a module if you don’t want to deal with paths.

<b-img :src="require('./img/jawnfinder-logo.png')"></b-img>

0👍

If you are using Vue-Loader, it won’t know that src on <b-img> is a project relative URL. You need to make sure you instruct Vue Loader which props in BootstrapVue are image src props:

https://bootstrap-vue.js.org/docs/reference/images

Leave a comment