module home

master
Bastien JACQUELIN 1 year ago
parent 24e6f4ff27
commit 4be186466a

@ -45,10 +45,10 @@
}
});
app.component('NavBar', NavBar);
app.component('TeamCard', TeamCard);
app.component('NewsCard',NewsCard);
app.component('HomeModule',HomeModule);
app.component('NavBar', NavBar);
app.mount('#app');
</script>

@ -1,12 +1,16 @@
export default{
data: function(){
return{
}
props:{
news:[]
},
data:function(){
return {}
},
methods:{
},
layout:`
template:`
<h2>Home</h2>
<div id="Teams" v-for="nouv in news">
<news-card title="nouv.title" date="nouv.publishedAt"/>
</div>
`
}

@ -25,8 +25,9 @@ export default{
},
clickHome: function() {
if(!this.homeClicked){
const api = NewsService();
this.news = api.get();
const api = new NewsService();
this.news = api.getNews();
console.log(this.news);
this.homeClicked=true;
this.teamClicked=false;
}
@ -113,12 +114,8 @@ export default{
<span @click="clickTeams" style="cursor: pointer">Teams</span>
<span>Results</span>
</div>
<div id="Home" v-if="homeClicked">
<h2>Homeee</h2>
<div id="Teams" v-for="new in news">
<news-card title="new.title" date="new.publishedAt"/>
</div>
</div>
<home-module v-if="homeClicked" :news=this.news></home-module>
<div id="Teams" v-if="teamClicked">
<form @submit.prevent>

Loading…
Cancel
Save