diff --git a/components/webtoons/episodes/EpisodeList.vue b/components/webtoons/episodes/EpisodeList.vue index e7832af..f025982 100644 --- a/components/webtoons/episodes/EpisodeList.vue +++ b/components/webtoons/episodes/EpisodeList.vue @@ -9,6 +9,7 @@ import VisibilityObserver from "~/components/utils/VisibilityObserver.vue"; const title = ref(""); const episodes = ref([]); const maxIndex = ref(30); +const newFirst = ref(true); const id = useRoute().params.id as any as number; @@ -34,6 +35,14 @@ function increaseMaxIndex(){ maxIndex.value += 30; } +function toggleOrder(){ + newFirst.value = !newFirst.value; +} + +const orderedEpisodes = computed(() => { + return newFirst.value ? episodes.value : [...episodes.value].reverse(); +}); + onMounted(() => { loadTitle(); loadEpisodes(); @@ -42,7 +51,11 @@ onMounted(() => {