how to access property of an object when its name is a number

1

this is my object

my code is this:

                  <table class="table">
                        <thead>
                            <tr>
                                <th>id</th>
                                <th>gana</th>

                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="values in juegosYlogros" :key="values.id">
                                <td>{{values.id}}</td>
                                <td>{{values.ganajuego.0.odds}}</td>

                            </tr>
                        </tbody>
                    </table>

    
asked by isaac josue castellanos perdom 30.12.2018 в 23:43
source

1 answer

3

The property ganajuego is of type array so to access the "property" 0 (actually it is a position, not a property) you should do it with the bracket notation like this: values.ganajuego[0].odds

    
answered by 31.12.2018 / 00:02
source