parent
665f8b3e68
commit
056d386d0c
@ -1,14 +1,34 @@
|
||||
export default {
|
||||
props: {
|
||||
linkHome: String,
|
||||
linkTeam: String,
|
||||
linkResults: String
|
||||
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:`
|
||||
<ul>
|
||||
<li><a href="#">Home</a></li>
|
||||
<li><a href="#team">Teams</a></li>
|
||||
<li><a href="https://www.github.com">Results</a></li>
|
||||
<li><a :href="linkHome">Home</a></li>
|
||||
<li @click="toggleDiv"><a :href="linkTeam">Team</a></li>
|
||||
<li><a target="_blank" :href="linkResults">Results</a></li>
|
||||
</ul>
|
||||
`
|
||||
|
||||
};
|
@ -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