feat(Home): 添加初始化完成状态控制头部标题显示 Fix #91
This commit is contained in:
@@ -10,6 +10,7 @@ interface Props {
|
||||
topTitle: string
|
||||
tableData: any[]
|
||||
setDefaultPersonList: () => void
|
||||
isInitialDone: boolean
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
@@ -26,7 +27,7 @@ const { t } = useI18n()
|
||||
>
|
||||
{{ topTitle }}
|
||||
</h2>
|
||||
<div class="flex gap-3">
|
||||
<div v-if="isInitialDone" class="flex gap-3">
|
||||
<button
|
||||
v-if="tableData.length <= 0" class="cursor-pointer btn btn-outline btn-secondary btn-lg"
|
||||
@click="router.push('config')"
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useViewModel } from './useViewModel'
|
||||
import 'vue-toast-notification/dist/theme-sugar.css'
|
||||
|
||||
const viewModel = useViewModel()
|
||||
const { setDefaultPersonList, tableData, currentStatus, enterLottery, stopLottery, containerRef, startLottery, continueLottery, quitLottery } = viewModel
|
||||
const { setDefaultPersonList, tableData, currentStatus, enterLottery, stopLottery, containerRef, startLottery, continueLottery, quitLottery, isInitialDone } = viewModel
|
||||
const globalConfig = useStore().globalConfig
|
||||
|
||||
const { getTopTitle: topTitle, getTextColor: textColor, getTextSize: textSize, getBackground: homeBackground } = storeToRefs(globalConfig)
|
||||
@@ -22,6 +22,7 @@ const { getTopTitle: topTitle, getTextColor: textColor, getTextSize: textSize, g
|
||||
:text-color="textColor"
|
||||
:top-title="topTitle"
|
||||
:set-default-person-list="setDefaultPersonList"
|
||||
:is-initial-done="isInitialDone"
|
||||
/>
|
||||
<div id="container" ref="containerRef" class="3dContainer">
|
||||
<OptionButton
|
||||
|
||||
@@ -51,6 +51,7 @@ export function useViewModel() {
|
||||
const luckyCount = ref(10)
|
||||
const personPool = ref<IPersonConfig[]>([])
|
||||
const intervalTimer = ref<any>(null)
|
||||
const isInitialDone = ref<boolean>(false)
|
||||
|
||||
function initThreeJs() {
|
||||
const felidView = 40
|
||||
@@ -597,6 +598,7 @@ export function useViewModel() {
|
||||
containerRef.value!.style.color = `${textColor}`
|
||||
randomBallData()
|
||||
window.addEventListener('keydown', listenKeyboard)
|
||||
isInitialDone.value = true
|
||||
}
|
||||
else {
|
||||
console.log('等待人员列表数据...')
|
||||
@@ -634,5 +636,6 @@ export function useViewModel() {
|
||||
enterLottery,
|
||||
tableData,
|
||||
currentStatus,
|
||||
isInitialDone,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user