q-checkbox is not working with v-for, what i am doing wrong?
-
I know that I am doing something wrong because q-checkbox and q-toggle both are not working in this case. Please help.
<tr v-for="(item, idx) in collection" :key="idx"> <td class="text-left"> <span> <q-checkbox :id="idx" v-model="item.selected" /> </span> {{ item.name }} </td> </tr>
-
@jitendra16 describe what’s not working.
-
check/uncheck is not working. if i try to change ‘name’ with q-input then ‘name’ is reactive and updating very well but ‘selected’ is not reactive with q-checkbox.
-
@jitendra16 try a more unique key than an index.
-
@metalsadman Please check codepen, everything working good in case of ‘q-list’ but not in case of ‘q-markup-table’
https://codepen.io/sharmaji16/pen/gOraJJZ -
@metalsadman i don’t have any unique key, so using index.
-
@jitendra16 you forgot to read the warning from the docs.
-
That’s really nasty if you don’t read that. You learn something every day with Quasar.
-
@metalsadman Thanks you. sorry i missed it.