implement the editing function of an article. After entering the editing page, the form will get the data of the original article
but bug, appears in the checkbox section. Clicking on one of the checkbox will select all or none of the checkbox, and only true and false
are bound to the array as follows
<div class="wrap classify">
<label></label>
<div class="classifyCheckbox">
<label>vue.js</label>
<input type="checkbox" value="vue.js" v-model="blog.classify">
<label>javascript</label>
<input type="checkbox" value="javascript" v-model="blog.classify">
<label>CSS</label>
<input type="checkbox" value="CSS" v-model="blog.classify">
<label>jQuery</label>
<input type="checkbox" value="jQuery" v-model="blog.classify">
</div>
</div>
data() {
return {
blog: {
id: null,
blogTitle: "",
blogContent: "",
classify: [],
type: ""
},
types: ["",""],
submited: false //
}
},
created() {
//
this.blog = this.$store.state.presentBlog;
}
initially classify only has "vue.js", but the page appears as follows:
checkbox
classifyfalse
what is the problem? Xiaobai asks for help