Skip to content Skip to sidebar Skip to footer

Vue Not Binding Data To Image Src

I'm having a problem binding data to src attribute in image. This is my code where I have :src and trying to bind image to it. Also I printed this.image in created() and it is gett

Solution 1:

You should import that image since it considered as a module like :

<img class="d-block w-100" :src="image" />

    export default {
      name: 'How',
      data(){
        return{
          image: require('../../assets/img/how_to_oka_6.png')
        }
      }
    }

Post a Comment for "Vue Not Binding Data To Image Src"