From 69d1ce44a4232a32a4adc7f368baeac1a6b78600 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 10 Dec 2024 14:05:52 +0100 Subject: [PATCH] feat: :sparkles: add multiselect --- src/components/Feed/Episode.vue | 20 ++++++++++++++++++-- src/components/Feed/Episodes.vue | 13 ++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/components/Feed/Episode.vue b/src/components/Feed/Episode.vue index d6ef43e..65d71b1 100644 --- a/src/components/Feed/Episode.vue +++ b/src/components/Feed/Episode.vue @@ -33,7 +33,7 @@ @@ -34,6 +37,7 @@ export default { data: () => ({ episodes: [] as EpisodeInterface[], loading: true, + selected: [] as EpisodeInterface[], }), computed: { ...mapState(usePlayer, ['episode']), @@ -88,6 +92,13 @@ export default { methods: { hasEnded, isListening, + select(episode: EpisodeInterface) { + if (this.selected.includes(episode)) { + this.selected = this.selected.filter((e) => e !== episode) + } else { + this.selected.push(episode) + } + }, }, }