refactor. 코드 간소화 및 불필요한 props 제거
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user