You try next code example:
<tr v-for="(item, i) of items" :key="i">
<td><input type="text" name="hour[]" :id="'hour-' + i"></td>
<td><input type= "checkbox" name="disable" v-on:click="disabled(i)"></td>
</tr>
function:
disabled(index){
$('#hour-' + index).attr('disabled', true);
}
You don’t have an element with #hour[i]
So you can change input element id
<tr v-for="(item, i) of items" :key="i">
<td><input type="text" name="hour[]" :id=`hour[${i} ]`></td>
<td><input type= "checkbox" name="disable" v-on:click="disabled(i)"></td>
</tr>
An input field is iterated in an array of items:
<tr v-for="(item, i) of items" :key="i">
<td><input type="text" name="hour[]" id="hour[]"></td>
<td><input type= "checkbox" name="disable" v-on:click="disabled(i)"></td>
</tr>
Is this how to write the function of disabled(i)
?
disabled(index){
$('#hour['+index+']').attr('disabled', true);
}