Solution 1 :

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);
}

Solution 2 :

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>

Problem :

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);
}

Comments

Comment posted by stackblitz.com/edit/vue-rd9tdk?file=src/components/…

You can see a example in this link:

By