From 707409b68cebccd12bf4ae3617798bf1ecd76a6a Mon Sep 17 00:00:00 2001 From: Hakadao Date: Tue, 15 Aug 2023 02:12:55 +0800 Subject: [PATCH] feat: enhanced functionality for the favorites page --- .../views/Favorites/Favorites.vue | 45 +++++++++++++++---- src/styles/main.scss | 2 +- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/contentScripts/views/Favorites/Favorites.vue b/src/contentScripts/views/Favorites/Favorites.vue index 695eba09..5474bc19 100644 --- a/src/contentScripts/views/Favorites/Favorites.vue +++ b/src/contentScripts/views/Favorites/Favorites.vue @@ -8,7 +8,7 @@ const { t } = useI18n() const favoriteCategories = reactive>([]) const favoriteResources = reactive>([]) -const activatedMediaId = ref(0) +const activatedCategoryId = ref(0) const activatedFavoriteTitle = ref() const currentPageNum = ref(1) const keyword = ref() @@ -16,7 +16,7 @@ const keyword = ref() const isLoading = ref() const noMoreContent = ref() -watch(activatedMediaId, (newVal: number, oldVal: number) => { +watch(activatedCategoryId, (newVal: number, oldVal: number) => { if (newVal === oldVal) return @@ -29,7 +29,7 @@ watch(activatedMediaId, (newVal: number, oldVal: number) => { onMounted(async () => { await getFavoriteCategories() - activatedMediaId.value = favoriteCategories[0].id + activatedCategoryId.value = favoriteCategories[0].id activatedFavoriteTitle.value = favoriteCategories[0].title // getFavoriteResources() }) @@ -120,7 +120,7 @@ function deleteWatchLaterItem(index: number, aid: number) { } function changeCategory(categoryItem: FavoriteCategory) { - activatedMediaId.value = categoryItem.id + activatedCategoryId.value = categoryItem.id activatedFavoriteTitle.value = categoryItem.title } @@ -134,11 +134,21 @@ function jumpToLoginPage() {