question-5
Bastien JACQUELIN 1 year ago
parent e1da4e74cb
commit 1b00a31de8

@ -1,6 +1,7 @@
class Team{
constructor(id, name){
constructor(id, name, description){
this.id=id;
this.name=name;
this.description=description;
}
}

@ -6,6 +6,7 @@ export default{
Results: '',
id:'',
name:'',
description:'',
clicked: false
}
},
@ -14,10 +15,11 @@ export default{
this.clicked=!this.clicked;
},
addTeam: function() {
let team = new Team(this.id, this.name);
let team = new Team(this.id, this.name, this.description);
console.log(team);
this.id='';
this.name='';
this.description='';
}
},
template:
@ -28,7 +30,7 @@ export default{
<span>Results</span>
</div>
<form @submit.prevent v-if="clicked">
<br>
<div>
<label>id</label><br/>
<input type="number" v-model="id"/>
@ -39,6 +41,11 @@ export default{
<input type="text" v-model="name"/>
</div>
<div>
<label>Description</label><br/>
<textarea v-model="description"></textarea>
</div>
<input type="submit" value="Submit" v-on:click="addTeam"/>
</form>
`

Loading…
Cancel
Save