close

How to use img src in vue.js?

Hello Guys, How are you all? Hope You all Are Fine. Today we are going to learn How to use img src in vue.js? in javascript. So Here I am Explain to you all the possible methods here.

Without wasting your time, Let’s start This Article.

How to use img src in vue.js?

  1. How to use img src in vue.js?

    to use img src in vue.js Try this:
    <img v-bind:src="'/media/avatars/' + joke.avatar" />
    Don't forget single quote around your path string. also in your data check you have correctly defined image variable.
    joke: { avatar: 'image.jpg' }

  2. How to use img src in vue.js?

    to use img src in vue.js Try this:
    <img v-bind:src="'/media/avatars/' + joke.avatar" />
    Don't forget single quote around your path string. also in your data check you have correctly defined image variable.
    joke: { avatar: 'image.jpg' }

Method 1

Try this:

<img v-bind:src="'/media/avatars/' + joke.avatar" /> 

Don’t forget single quote around your path string. also in your data check you have correctly defined image variable.

joke: {
  avatar: 'image.jpg'
}

Summery

It’s all About this article. Hope all method helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which method worked for you? Thank You.

Leave a Comment