vuejs: if i get values of checked box by v-model but not set checkbox checked dynaiclly from database. On other hand if i can set chechbox checked dynamically but not able to get values of checked checkbox.
With this i get value of checked checkbox but not set checked dynamically
<li v-for="swv in appointment.switch_shift " >
<input type="checkbox" :value="swv.id" v-model="checkshifts"
@change="shiftSwitch()" />
<label > {{ swv.name}}</label>
</li>
----------------------------------------
data : {1: {id: 1, name: "Morning", active: true}, 2: {id: 2, name: "Afternoon", active: false},…}
if set checkbox checked dynamically with the following code but not able get values of checked check box.
<li v-for="swv in appointment.switch_shift " >
<input type="checkbox" v-model="swv.active"
@change="shiftSwitch()" />
<label > {{ swv.name}}</label>
</li>
I expected that both operation should worked together. thanks