I'm trying to bind
a property
of an item
that belongs to an array
in the data object of vue to the value attribute
of an input tag
, but it does not show up if I look at it in the DOM
of a web browser.
<template v-for="role in roles">
<tr>
<td>{{ role.Name }}</td>
<td>
<button type="button" class="btn-danger" @@click="RemoveRole(role)">Remove</button>
</td>
<td hidden>
<input type="text" :id="role.Id" name="role[]" v-model="role.Id"/> // results in just "<input type="text" id="..." name="role[]" />"
// there is no value attribute visible, but the Id attribute can give the right value?
</td>
</tr>
</template>
The id
attribute
can give the right value so why cant the value attribute
?
:value="role.Id"
does not work.
Does anyone have a clue.