auto increment <orking well

master
Bastien JACQUELIN 1 year ago
parent 964aa2f3c1
commit 4b7af38fe5

@ -66,15 +66,17 @@ export default{
}
},
addTeam: function(){
let team = new Team(this.id, this.name, this.description);
console.log(team);
if(!this.edit){//adding a team
let team = new Team(this.id, this.name, this.description);
console.log(team);
this.teams.push(team);
this.name='';
this.description='';
this.id=this.id+1
}
else{//editing a team
let team = new Team(this.teams[this.idxEdit].id, this.name, this.description);
console.log(team);
this.teams[this.idxEdit]=team;
this.name='';
this.description='';

Loading…
Cancel
Save