commit
837559978f
@ -1,3 +1,3 @@
|
|||||||
# TP_JavaScript
|
# TP_JavaScript
|
||||||
|
|
||||||
HODIN Dorian / LACOTE Raphaël
|
Développeurs: HODIN Dorian , LACOTE Raphaël
|
@ -0,0 +1,5 @@
|
|||||||
|
class RequiredFieldError extends Error {
|
||||||
|
constructor(field) {
|
||||||
|
super('Le champ '+field+' est obligatoire !');
|
||||||
|
}
|
||||||
|
}
|
@ -1,11 +1,34 @@
|
|||||||
export default {
|
export default {
|
||||||
|
props: {
|
||||||
|
linkHome: {
|
||||||
|
type: String,
|
||||||
|
default: '#'
|
||||||
|
},
|
||||||
|
linkTeam:{
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
linkResults: {
|
||||||
|
type: String,
|
||||||
|
default: 'https://www.github.com'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
toggleDiv: function(){
|
||||||
|
let div = document.getElementById("team");
|
||||||
|
if (div.classList.contains("hide")) {
|
||||||
|
div.classList.remove("hide");
|
||||||
|
} else {
|
||||||
|
div.classList.add("hide");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
template:`
|
template:`
|
||||||
<section>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#">Home</a></li>
|
<li><a :href="linkHome">Home</a></li>
|
||||||
<li><a href="#">Teams</a></li>
|
<li @click="toggleDiv"><a :href="linkTeam">Team</a></li>
|
||||||
<li><a href="#">Results</a></li>
|
<li><a target="_blank" :href="linkResults">Results</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
|
||||||
`
|
`
|
||||||
|
|
||||||
};
|
};
|
@ -0,0 +1,32 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
id: {
|
||||||
|
type :String,
|
||||||
|
require : true
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type :String,
|
||||||
|
require : true
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
type :String,
|
||||||
|
require : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
description20(){
|
||||||
|
if (this.description.length > 20) {
|
||||||
|
return this.description.substring(0, 20) + '...';
|
||||||
|
} else {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
template: `
|
||||||
|
<div class="team-card">
|
||||||
|
<span>ID of the Team : {{ id }}</span>
|
||||||
|
<p>Name : {{ name }}</p>
|
||||||
|
<p>Description : {{ description20 }}</p>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
}
|
Loading…
Reference in new issue