<template>
    <RouterView class="container h-full bg-[#11131E]" />
</template>

<script setup>
import { onMounted, onBeforeUnmount } from 'vue'
import { emitter } from '@/utils/eventBus'
import { showConfirmDialog } from 'vant'
import { useRouter } from 'vue-router'

const router = useRouter()
const promptLogin = async () => {
    showConfirmDialog({
        title: '登录查看更多精彩'
        // message: '登录查看更多精彩'
    }).then(() => {
        router.push('/login')
    })
}

onMounted(() => {
    emitter.on('promptLogin', promptLogin)
})

onBeforeUnmount(() => {
    emitter.off('promptLogin', promptLogin)
})
</script>

<style lang="less" scoped>
.container {
    min-height: 100vh;
    // overflow-y: auto;
}
</style>
