|
|
@ -3,7 +3,7 @@ export default{
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
teams:[],
|
|
|
|
teams:[],
|
|
|
|
news: [],
|
|
|
|
news: [],
|
|
|
|
id:'',
|
|
|
|
id: 1,
|
|
|
|
name:'',
|
|
|
|
name:'',
|
|
|
|
description:'',
|
|
|
|
description:'',
|
|
|
|
teamClicked: false,
|
|
|
|
teamClicked: false,
|
|
|
@ -38,15 +38,10 @@ export default{
|
|
|
|
},
|
|
|
|
},
|
|
|
|
checkFields: function() {
|
|
|
|
checkFields: function() {
|
|
|
|
this.errMessage="";
|
|
|
|
this.errMessage="";
|
|
|
|
document.querySelector("#id").removeAttribute("style");
|
|
|
|
|
|
|
|
document.querySelector("#name").removeAttribute("style");
|
|
|
|
document.querySelector("#name").removeAttribute("style");
|
|
|
|
document.querySelector("#desc").removeAttribute("style");
|
|
|
|
document.querySelector("#desc").removeAttribute("style");
|
|
|
|
if(this.id===""||this.name===""||this.description===""){
|
|
|
|
if(this.name===""||this.description===""){
|
|
|
|
this.errMessage+="The";
|
|
|
|
this.errMessage+="The";
|
|
|
|
if(this.id===""){
|
|
|
|
|
|
|
|
this.errMessage+=" id";
|
|
|
|
|
|
|
|
document.querySelector("#id").setAttribute("style","border: 1px solid #d66");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.name===""){
|
|
|
|
if(this.name===""){
|
|
|
|
this.errMessage+=" name";
|
|
|
|
this.errMessage+=" name";
|
|
|
|
document.querySelector("#name").setAttribute("style","border: 1px solid #d66");
|
|
|
|
document.querySelector("#name").setAttribute("style","border: 1px solid #d66");
|
|
|
@ -74,13 +69,12 @@ export default{
|
|
|
|
console.log(team);
|
|
|
|
console.log(team);
|
|
|
|
if(!this.edit){//adding a team
|
|
|
|
if(!this.edit){//adding a team
|
|
|
|
this.teams.push(team);
|
|
|
|
this.teams.push(team);
|
|
|
|
this.id='';
|
|
|
|
|
|
|
|
this.name='';
|
|
|
|
this.name='';
|
|
|
|
this.description='';
|
|
|
|
this.description='';
|
|
|
|
|
|
|
|
this.id=this.id+1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{//editing a team
|
|
|
|
else{//editing a team
|
|
|
|
this.teams[this.idxEdit]=team;
|
|
|
|
this.teams[this.idxEdit]=team;
|
|
|
|
this.id='';
|
|
|
|
|
|
|
|
this.name='';
|
|
|
|
this.name='';
|
|
|
|
this.description='';
|
|
|
|
this.description='';
|
|
|
|
this.edit=false;
|
|
|
|
this.edit=false;
|
|
|
@ -94,12 +88,10 @@ export default{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if(this.edit){
|
|
|
|
if(this.edit){
|
|
|
|
this.id=team.id;
|
|
|
|
|
|
|
|
this.name=team.name ;
|
|
|
|
this.name=team.name ;
|
|
|
|
this.description=team.description;
|
|
|
|
this.description=team.description;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
else{
|
|
|
|
this.id='';
|
|
|
|
|
|
|
|
this.name='';
|
|
|
|
this.name='';
|
|
|
|
this.description='';
|
|
|
|
this.description='';
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -122,11 +114,7 @@ export default{
|
|
|
|
<form @submit.prevent>
|
|
|
|
<form @submit.prevent>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<label>{{errMessage}}</label><br/>
|
|
|
|
<label>{{errMessage}}</label><br/>
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<label>id</label><br/>
|
|
|
|
|
|
|
|
<input id="id" type="number" v-model="id"/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<label>Name</label><br/>
|
|
|
|
<label>Name</label><br/>
|
|
|
|
<input id="name" type="text" v-model="name"/>
|
|
|
|
<input id="name" type="text" v-model="name"/>
|
|
|
|