vue: @click and input: v-model execution order

I found a small problem today.
Click the checkbox below the picture. What the
insert image description here
console prints is that
insert image description here
the checkbox is obviously selected, but the printed content is false. This is a bit interesting. Look at the code
<input
type="checkbox"
v- model="checked[i]"
name=""
@click="handleChecked"
class="checked">
insert image description here
Obviously there is no problem with the operation, but there is a problem, so I suspect it is asynchronous,
so add a timer to
insert image description here
see the printing effect
insert image description here
The last two lines are timer printing
Summary: v-model and @click execution order in vue
@click -> v-model

Guess you like

Origin blog.csdn.net/weixin_46112649/article/details/114689173