2020-07-25 01:44:19 +00:00
|
|
|
<template>
|
|
|
|
<div class="movies">
|
2020-08-15 17:04:33 +00:00
|
|
|
<div class="content-inner">
|
|
|
|
<div class="tiles">
|
|
|
|
<MovieTile
|
|
|
|
v-for="movie in movies"
|
|
|
|
:key="`movie-${movie.id}`"
|
|
|
|
:movie="movie"
|
|
|
|
/>
|
|
|
|
</div>
|
2020-08-01 13:11:07 +00:00
|
|
|
</div>
|
2020-08-15 17:04:33 +00:00
|
|
|
|
|
|
|
<Footer />
|
2020-07-25 01:44:19 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2020-08-01 13:11:07 +00:00
|
|
|
<script>
|
2020-08-12 01:30:20 +00:00
|
|
|
import MovieTile from './movie-tile.vue';
|
2020-08-01 13:11:07 +00:00
|
|
|
|
|
|
|
async function mounted() {
|
|
|
|
const { movies, totalCount } = await this.$store.dispatch('fetchMovies', {
|
|
|
|
limit: 30,
|
|
|
|
});
|
|
|
|
|
|
|
|
this.movies = movies;
|
|
|
|
this.totalCount = totalCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2020-08-12 01:30:20 +00:00
|
|
|
MovieTile,
|
2020-08-01 13:11:07 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
movies: [],
|
|
|
|
totalCount: 0,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted,
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2020-08-12 01:30:20 +00:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import 'breakpoints';
|
|
|
|
|
2020-07-25 01:44:19 +00:00
|
|
|
.movies {
|
2020-08-15 17:04:33 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex-grow: 1;
|
2020-07-25 01:44:19 +00:00
|
|
|
}
|
2020-08-01 13:11:07 +00:00
|
|
|
|
|
|
|
.tiles {
|
|
|
|
display: grid;
|
2020-08-10 19:39:55 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr));
|
2020-08-08 16:10:59 +00:00
|
|
|
grid-gap: 1rem;
|
2020-08-01 13:11:07 +00:00
|
|
|
}
|
2020-08-12 01:30:20 +00:00
|
|
|
|
|
|
|
@media(max-width: $breakpoint) {
|
|
|
|
.tiles {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
|
|
|
|
}
|
|
|
|
}
|
2020-07-25 01:44:19 +00:00
|
|
|
</style>
|