commit
1860d27569
@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/TP_JavaScript.iml" filepath="$PROJECT_DIR$/.idea/TP_JavaScript.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,5 @@
|
|||||||
|
class StringSize extends Error {
|
||||||
|
constructor(field,sSize) {
|
||||||
|
super('Le champ ' + field + ' doit avoir une taille superieur à '+sSize);
|
||||||
|
}
|
||||||
|
}
|
@ -1 +1,3 @@
|
|||||||
const ERROR_COLOR = 'red';
|
const ERROR_COLOR = 'red';
|
||||||
|
const DESCRIPTION_MINIMAL_SIZE = 1;
|
||||||
|
const NAME_MINIMAL_SIZE = 1;
|
@ -0,0 +1,52 @@
|
|||||||
|
import teamAdd from './team-add.js';
|
||||||
|
import teamCard from './teamcard.js';
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data: function() {
|
||||||
|
return {
|
||||||
|
allTeam: [],
|
||||||
|
teamAEdit: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
recupTeam: function (team) {
|
||||||
|
console.log('team.addTeam', team);
|
||||||
|
this.allTeam.push(team);
|
||||||
|
},
|
||||||
|
editParam: function (team) {
|
||||||
|
this.teamAEdit=team
|
||||||
|
console.log('lanceEdit')
|
||||||
|
},
|
||||||
|
updateTeam: function (team) {
|
||||||
|
console.log('update')
|
||||||
|
for (var i = 0; i < this.allTeam.length; i++) {
|
||||||
|
if (this.allTeam[i].id == this.teamAEdit.id) {
|
||||||
|
console.log('update + +')
|
||||||
|
this.allTeam[i].name = team.name
|
||||||
|
this.allTeam[i].description=team.description
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
teamCard,
|
||||||
|
teamAdd
|
||||||
|
},
|
||||||
|
template: `
|
||||||
|
<section>
|
||||||
|
<h2>News form</h2>
|
||||||
|
<div class="team">
|
||||||
|
<teamAdd :teamAEdit="this.teamAEdit" v-on:teamAjoute="recupTeam" v-on:teamModifie="updateTeam"></teamAdd>
|
||||||
|
</div>
|
||||||
|
<teamCard v-for="team in allTeam"
|
||||||
|
:id="team.id"
|
||||||
|
:name="team.name"
|
||||||
|
:description="team.description"
|
||||||
|
v-on:teamEditer="editParam">
|
||||||
|
</teamCard>
|
||||||
|
</section>
|
||||||
|
`
|
||||||
|
}
|
Loading…
Reference in new issue