Skip to content
Snippets Groups Projects
Commit 6c7faea2 authored by EL MOUADDAB ISMAIL p2103017's avatar EL MOUADDAB ISMAIL p2103017
Browse files

mise à jour

parent 943dd540
No related branches found
No related tags found
No related merge requests found
# frontend
n# frontend
This template should help get you started developing with Vue 3 in Vite.
......
<template>
<div class="film-poster">
<img :src="film.poster" :alt="film.title" />
<h3>{{ film.title }}</h3>
<!-- Ajoutez d'autres détails du film ici -->
</div>
</template>
<script>
export default {
props: {
film: {
type: Object,
required: true
}
}
};
</script>
<style scoped>
/* Styles pour la disposition des affiches */
.film-poster {
width: 20%; /* Pour afficher 4 affiches par rangée */
margin: 10px;
display: inline-block;
text-align: center;
}
</style>
<template>
<div class="film-row">
<div v-for="film in films" :key="film.id">
<FilmPoster :film="film" />
</div>
</div>
</template>
<script>
import FilmPoster from './FilmPoster.vue';
export default {
components: {
FilmPoster
},
props: {
films: {
type: Array,
required: true
}
}
};
</script>
<style scoped>
/* Styles pour la disposition des rangées */
.film-row {
text-align: center;
}
</style>
\ No newline at end of file
<script setup>
import Header from '../components/Header.vue'
import FilmRow from '../components/FilmRow.vue';
</script>
<template>
......@@ -13,6 +14,41 @@ import Header from '../components/Header.vue'
</template>
<script>
import Header from '../components/Header.vue'
import FilmRow from '../components/FilmRow.vue';
export default {
components: {
Header,
FilmRow
},
data() {
return {
films: [
{ id: 1, title: 'Film 1', poster: 'lien_vers_affiche_1' },
{ id: 2, title: 'Film 2', poster: 'lien_vers_affiche_2' },
],
filmsInRows: []
};
},
mounted() {
this.filmsInRows = this.chunkArray(this.films, 4);
},
methods: {
chunkArray(array, size) {
const chunkedArr = [];
let index = 0;
while (index < array.length) {
chunkedArr.push(array.slice(index, size + index));
index += size;
}
return chunkedArr;
}
}
};
</script>
<style scoped>
input {
display: block;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment