VUEJS: Property or method "indicatorTitle" is not defined

Asked

Viewed 27 times

0

I have a simple variable and I want to pass it to my v-for. However, I get the error "Property or method "indicatorTitle" is not defined on the instance but referenced".

The way I’m trying:

<div class="row">
  <div class="col-md" v-for="title in titles" v-bind:key="title.indicatorTitle">
     {{ indicatorTitle }}
                            <div class="card" >
                                <div class="card-body">
                                    <ul> 
                                        <li class="groupCategory">           
                                                
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>

data: function () {
    return {
        titles: [
        { indicatorTitle: "Teste 3" },
        { indicatorTitle: "Teste 2" }, 
        { indicatorTitle: "Teste 1" }
        ]
    }
```
  • 2

    you have to call it from the object: {{ title.indicatorTitle }}

  • Ish, you’re right, I completely forgot. Thank you so much

  • 1

    @Helderlucas: There’s an answer? :)

  • 1

    I’ll gladly accept the answer when I make it, @Helderlucas

1 answer

1


Being titles an object,indicatorTitle has to be called as a property of it, as for example: {{ title.indicatorTitle }} :)

  • 1

    Thank you for the reply! :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.