0

I have created a db where all the games are stored. In the js part I'm sending a request for getting all games, then putting the result into games[] list. When I'm trying to assign the images that are stored in db, in js games[index]['cover_img'], they are not showing.

        <div class="all_games">
        <div class="game" v-for='(val, index) in games' :key='index'>  
        <img :scr="getImg(index)" alt='game'> 
        <h2> {{games[index]['title']}}</h2> 
        <h2> {{games[index]['price'] + conc}} </h2>
        <input v-if=(checkAvailable(index)) type='submit' class=' pointer ' name='submit' value='Add to cart' @click='addGame' /> 
        <p v-else> OUT OF STOCK </p>     
    
        </div> 

I've tryed to access images with function getImg:

getImg(index){
            return '/static/images/store/'+ this.games[index]['cover_img'];
        },

But they are not showing. How can I fix this?

2 Answers 2

1

Check if you have a since you use vuejs :src. Nice thing to add :add.

Sign up to request clarification or add additional context in comments.

1 Comment

did you ment div id ="app"? and :alt?
0

change scr to src in <img> tag

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.