Answer the question
In order to leave comments, you need to log in
Why are changes to data delayed?
Greetings.
Essence: there is an array of data, under which a number of custom checkboxes are displayed in a loop.
To make them some kind of label, I add
But for some reason, the change gets into the data only after nextTick (that is, when something induces the parent component to redraw). How so, in which direction to dig?
<template>
<div v-for="(day, key) in $options._weekDays" :key="key">
<v-simple-checkbox v-model="innerValue[key][0]"></v-simple-checkbox>
<div @click="innerValue[key][0] = !innerValue[key][0]">{{day}}</div>
</div>
</template>
<script>
export default {
_weekDays: {
monday: "Понедельник",
tuesday: "Вторник",
wednesday: "Среда",
thursday: "Четверг",
friday: "Пятница",
saturday: "Суббота",
sunday: "Воскресенье",
},
data() {
return {
innerValue: {
monday: [false, "", ""],
tuesday: [false, "", ""],
wednesday: [false, "", ""],
thursday: [false, "", ""],
friday: [false, "", ""],
saturday: [false, "", ""],
sunday: [false, "", ""],
},
}
},
}
</script>
Answer the question
In order to leave comments, you need to log in
for some reason, the change gets into the data only after nextTick (i.e. when something induces the parent component to redraw)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question