refactor. 코드 간소화 및 불필요한 props 제거

This commit is contained in:
clkim
2026-03-23 15:04:30 +09:00
parent 8c2b98369a
commit e457209024
4 changed files with 7 additions and 17 deletions

View File

@@ -1,15 +1,12 @@
<script setup lang="ts">
import type { ColorObject, TrackingObject } from '#layers/types/api/common'
interface Props {
backgroundColor: ColorObject
}
const props = defineProps<Props>()
import type { TrackingObject } from '#layers/types/api/common'
const { locale } = useI18n()
const { y: windowY } = useWindowScroll({ behavior: 'smooth' })
const { sendLog } = useAnalytics()
const pageDataStore = usePageDataStore()
const { topBtnColorJson } = storeToRefs(pageDataStore)
const analytics = {
action_type: 'click',
@@ -19,7 +16,7 @@ const analytics = {
const showBtn = computed(() => windowY.value > 0)
const backgroundColor = computed(
() => getColorCodeFromData(props.backgroundColor, 'none') ?? 'var(--primary)'
() => getColorCodeFromData(topBtnColorJson.value, 'none') ?? 'var(--primary)'
)
const handleScrollToTop = () => {