for beginners in vue, try to write a function of the examination system and add questions.
< hr > < H2 > I wanted to add a big topic, but the previous big topic number has also changed. This big topic is push into the all one by one. What"s going on, or is it the update mechanism of vue? < / H2 >new Vue({
el: "-sharptodo-list-example",
data: {
bid:1,//
sid:1,//
all:[],
one:{bid:1,title:"xxx",mark:1,rand1:true,rand2:true,questions:{}}
},
methods: {
addbig: function() {//
// this.one.questions["Q"+this.sid]="123"+this.sid;
this.one.bid=this.bid;
this.all.push(this.one);
this.sid=1;
this.bidPP;//
console.log(this.all);
},
addsmall: function() {//
this.one.questions["Q"+this.sid]="123"+this.sid;
//this.all.push(this.one);
this.sidPP;
console.log(JSON.stringify(this.all));
}
}
})