fix. [QA] 액션 버튼 동작 이슈 수정 (PWT-53, PWT-67)

This commit is contained in:
clkim
2025-11-25 18:56:02 +09:00
parent 319d299cfe
commit f98c7051f3
4 changed files with 106 additions and 49 deletions

View File

@@ -1,14 +1,14 @@
<script setup lang="ts">
import type { PageDataLnbMenu } from '#layers/types/api/pageData'
const { y: windowY, directions } = useWindowScroll({ behavior: 'smooth' })
const { directions } = useWindowScroll({ behavior: 'smooth' })
const pageDataStore = usePageDataStore()
const scrollStore = useScrollStore()
const breakpoints = useResponsiveBreakpoints()
const { pageData } = storeToRefs(pageDataStore)
// 상수 정의
const HEADER_HEIGHT = 64
const OBSERVER_OPTIONS = {
root: null,
rootMargin: '-20% 0px -60% 0px', // 상단 20%, 하단 60% 마진
@@ -104,15 +104,7 @@ const handleLnbClick = (lnbItem: PageDataLnbMenu) => {
? lnbItem?.children?.['1']?.page_ver_tmpl_name_en
: lnbItem.page_ver_tmpl_name_en
const targetElement = document.getElementById(targetId)
if (!targetElement) return
// 헤더 높이를 고려한 스크롤 위치 계산
const elementTop = targetElement.getBoundingClientRect().top
const currentScrollY = window.scrollY
const targetScrollY = currentScrollY + elementTop - HEADER_HEIGHT
windowY.value = targetScrollY
scrollStore.scrollToAnchor(targetId)
}
watch(directions, newVal => {