From d459d42a60283adbac3fa517836a467b965c20bf Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 14 Aug 2024 15:43:40 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=8B=9C=EB=A6=AC=EC=A6=88=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20-=20scroll=20infinite=20loading=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20paging=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 8 +++++++ src/views/Content/ContentSeriesList.vue | 31 +++++++++++++++++++------ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3ec463e..168da05 100644 --- a/src/App.vue +++ b/src/App.vue @@ -38,4 +38,12 @@ } } } + +html::-webkit-scrollbar, body::-webkit-scrollbar { + overflow-y: hidden; +} + +html, body { + overflow-y: hidden; +} diff --git a/src/views/Content/ContentSeriesList.vue b/src/views/Content/ContentSeriesList.vue index 142cac8..11752eb 100644 --- a/src/views/Content/ContentSeriesList.vue +++ b/src/views/Content/ContentSeriesList.vue @@ -22,7 +22,11 @@ - + = threshold - 10 && this.total_page >= this.page) { + await this.getSeriesList(); + } + }, + imageAdd(payload) { const file = payload; if (file) { @@ -486,7 +498,6 @@ export default { }, async getSeriesGenreList() { - this.is_loading = true try { const res = await api.getGenreList() if (res.status === 200 && res.data.success === true) { @@ -496,23 +507,24 @@ export default { } else { this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') } - - this.is_loading = false } catch (e) { this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') - this.is_loading = false } }, async getSeriesList() { + if (this.is_loading) return; + this.is_loading = true try { const res = await api.getSeriesList(this.page) if (res.status === 200 && res.data.success === true) { const data = res.data.data + const total_page = Math.ceil(data.totalCount / 10) - const total_page = Math.ceil(data.totalCount / 20) - this.series_list = data.items + if (this.page === 1) this.series_list.length = 0; + this.page += 1; + this.series_list.push(...data.items); if (total_page <= 0) this.total_page = 1 @@ -665,6 +677,11 @@ export default {