From 1c566b19cb5f562afeeef6eb063fefb06fb019ca Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Sun, 14 Jan 2024 00:33:23 +0100 Subject: [PATCH] refacto: move hash to computed values --- src/components/Discover/TopItem.vue | 8 +++++--- src/components/Player/Infos.vue | 8 ++++---- src/components/Sidebar/Item.vue | 8 ++++++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/Discover/TopItem.vue b/src/components/Discover/TopItem.vue index 9abdc16..00c4212 100644 --- a/src/components/Discover/TopItem.vue +++ b/src/components/Discover/TopItem.vue @@ -1,5 +1,5 @@ @@ -27,8 +27,10 @@ export default { required: true, }, }, - methods: { - toUrl, + computed: { + hash() { + return toUrl(this.link) + }, }, } diff --git a/src/components/Player/Infos.vue b/src/components/Player/Infos.vue index e4f445e..a955473 100644 --- a/src/components/Player/Infos.vue +++ b/src/components/Player/Infos.vue @@ -3,7 +3,7 @@ {{ player.episode.name }} - + {{ player.episode.podcast }} @@ -18,9 +18,9 @@ export default { player() { return this.$store.state.player }, - }, - methods: { - toUrl, + hash() { + return toUrl(this.player.podcastUrl) + }, }, } diff --git a/src/components/Sidebar/Item.vue b/src/components/Sidebar/Item.vue index 423d864..2b18f70 100644 --- a/src/components/Sidebar/Item.vue +++ b/src/components/Sidebar/Item.vue @@ -1,7 +1,7 @@