I have a problem with my code. I want to access the value of assignmentData in file1.vue everytime after it changes in another vue file(file2.vue). You can see the code in the pictures. And the data of assignmentData changes everytime a checkbox is marked/unmarked. How do i correctly use v-bind or v-model to get the value in my second file everytime it changes.
The code of the checkbox in file1.vue:
‹div class="col-smfz-11" style="margin-top: -40рх;" › ‹label id="kursAusgewählt" class="checkbox-container> < input type="checkbox" :checked="assignmentData.selected" @change="update('selected', $event. target.checked)"› ‹span class="checkmark" style="margin-left: -40px; margin-top:33px;*› &bsp;&bsp;&bsp;&bsp;&bsp;&bsp;&bsp;Check</span>
The update function:update (key, value) { this.assignmentData[key] = value; this. $emit('update:assignmentData', this.assignmentData);
And in file2.vue how do i access this LIVE(!!!) data?
It was always showing undefined when i tried to access via v-bind
user24703227 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.