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 = () => {
|
||||
|
||||
@@ -28,9 +28,7 @@ const lnbList = computed<Record<string, PageDataLnbMenu>>(
|
||||
)
|
||||
const isShowLnb = computed(() => {
|
||||
return Boolean(
|
||||
pageData.value?.use_lnb &&
|
||||
breakpoints.value.isDesktop &&
|
||||
Object.keys(lnbList.value).length > 0
|
||||
breakpoints.value.isDesktop && Object.keys(lnbList.value).length > 0
|
||||
)
|
||||
})
|
||||
const activeColor = computed(
|
||||
|
||||
@@ -19,7 +19,6 @@ const {
|
||||
isUseSnsBtn,
|
||||
isUseLnb,
|
||||
isLoginRequired,
|
||||
topBtnColorJson,
|
||||
} = storeToRefs(pageDataStore)
|
||||
const { gameMetaTag } = storeToRefs(gameDataStore)
|
||||
|
||||
@@ -105,10 +104,7 @@ onMounted(() => {
|
||||
<ClientOnly>
|
||||
<BlocksLnb v-if="isUseLnb" />
|
||||
<div v-if="isUseTopBtn" class="utile-wrap">
|
||||
<BlocksButtonScrollTop
|
||||
v-if="isUseTopBtn"
|
||||
:background-color="topBtnColorJson"
|
||||
/>
|
||||
<BlocksButtonScrollTop v-if="isUseTopBtn" />
|
||||
</div>
|
||||
</ClientOnly>
|
||||
<BlocksSns v-if="isUseSnsBtn" />
|
||||
|
||||
@@ -117,7 +117,6 @@ onBeforeUnmount(() => {
|
||||
alt="main image"
|
||||
/>
|
||||
<AtomsButtonPlay
|
||||
v-if="playingSlideIndex !== index"
|
||||
class="btn-play"
|
||||
:background-color="
|
||||
getColorCodeFromData(videoPlayData?.display, 'none')
|
||||
|
||||
Reference in New Issue
Block a user