44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
|
<main>
|
||
|
<h3>{props.title}</h3>
|
||
|
<h2 if="{this.state.isLoading}">Loading</h2>
|
||
|
<h4 if={this.state.movieList}> Résultats {state.message}</h4>
|
||
|
<search updateListFilm="{updateListFilm}" updateLoading="{updateLoading}"></search>
|
||
|
<img class="spinner" if={this.state.isLoading == true } src="./DesertedDazzlingBudgie-size_restricted.gif" />
|
||
|
<kind updateListFilm="{updateListFilm}"></kind>
|
||
|
<sorting updateListFilm="{updateListFilm}" updateLoading="{updateLoading}"></sorting>
|
||
|
<film movies="{this.state.movieList}"></film>
|
||
|
<script>
|
||
|
export default
|
||
|
{
|
||
|
|
||
|
onBeforeMount (props,state) {
|
||
|
this.state = {
|
||
|
movieList : [],
|
||
|
isLoading : false
|
||
|
}
|
||
|
this.getMovie();
|
||
|
},
|
||
|
onMounted(){
|
||
|
|
||
|
},
|
||
|
async getMovie(){
|
||
|
this.state.movieList = await this.sa.discover();
|
||
|
console.log(this.state.movieList)
|
||
|
this.updateListFilm(this.state.movieList.results)
|
||
|
}
|
||
|
,
|
||
|
async updateListFilm(listFilms){
|
||
|
this.update({movieList : listFilms});
|
||
|
//console.log(this.state.movieList)
|
||
|
},
|
||
|
updateLoading(bool){
|
||
|
|
||
|
this.update({
|
||
|
isLoading : bool
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
<footer>CINEMAMA</footer>
|
||
|
</main>
|