diff --git a/frontend/src/pages/profile/MatchHistory.vue b/frontend/src/pages/profile/MatchHistory.vue index 53ebc87..584ff84 100644 --- a/frontend/src/pages/profile/MatchHistory.vue +++ b/frontend/src/pages/profile/MatchHistory.vue @@ -15,10 +15,22 @@ const tab = ref('전체') // 다른 유저로 전환 시 탭 초기화 watch(() => props.p.name, () => (tab.value = '전체')) +// 더보기 페이지 크기 — 개발 4개 / 운영 20개 +const PAGE_SIZE = import.meta.env.DEV ? 4 : 20 +const limit = ref(PAGE_SIZE) +// 유저/탭 전환 시 노출 개수 초기화 +watch([() => props.p.name, tab], () => (limit.value = PAGE_SIZE)) + const ms = computed(() => tab.value === '전체' ? props.p.matches : props.p.matches.filter((m) => m.mode === tab.value), ) const wins = computed(() => ms.value.filter((m) => m.win).length) +const visible = computed(() => ms.value.slice(0, limit.value)) +const hasMore = computed(() => ms.value.length > limit.value) + +function showMore() { + limit.value += PAGE_SIZE +} @@ -97,4 +116,26 @@ const wins = computed(() => ms.value.filter((m) => m.win).length) font-size: 0.8125rem; color: var(--t3); } +.mh__more { + display: block; + width: 100%; + padding: 11px 0; + border: none; + border-top: 1px solid var(--line); + background: var(--surf); + cursor: pointer; + font-family: var(--font-body); + font-size: 0.78125rem; + font-weight: 700; + color: var(--t2); +} +.mh__more:hover { + background: #f7f8f9; +} +.mh__more-count { + margin-left: 4px; + font-size: 0.6875rem; + font-weight: 600; + color: var(--t3); +}