J.Algaba
J.Algaba

Reputation: 76

Html Value Binding

im working with .Net and Vue and I cant really bind a value in a label

   <li v-for="restaurant in vHolidays.data" >
                        <form id="1">
                            <div>
                                <label >{{restaurant.restaurantId}}</label>
                                <input type="text" class="form-control"   value=HERE>

                            </div>
                            <button type="button" class="btn btn-danger btn-block" @click="test()">Modificar</button>
                        </form>



                    </li>

In "HERE" I want to put the same as {{restaurant.restaurantId}} that alredy works . Thanks

Upvotes: 0

Views: 34

Answers (1)

Igor
Igor

Reputation: 809

You should use v-bind directive to bind tag attribute values to Vue expression:

<input type="text" class="form-control" v-bind:value="restaurant.restaurantId">

or its shorthand ::

<input type="text" class="form-control" :value="restaurant.restaurantId">

Read more about this directive here: link

Upvotes: 1

Related Questions