fix. [QA] 액션 버튼 동작 이슈 수정 (PWT-53, PWT-67)
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user