Hello there,
I'm encountering an issue with the input toggle switch value in my Vue component. Whenever it is emitted to the parent component, the value seems to be flipped to its reverse. I am relatively new to Vue and have been experimenting with it for a few days now. While I can see the attribute value in both areas using vue dev tools, the value becomes reversed when passed to the parent component. A quick fix would be adding a "!" to the incoming value, but I'd like to understand why this behavior is happening.
Parent Component Update
updateMiddle(article){
this.article.meta_title = article.meta_title;
this.article.meta_desc = article.meta_desc;
this.article.published = article.published;
this.article.is_review = !article.is_review; // Quick fix
}
Child Component Emit
methods: {
update() {
this.$emit('changeMiddle',this.article)
}
Input Element
<input id="tc-review" type="checkbox" hidden="hidden" name="is_review"
v-model="article.is_review" v-on:input="update">