fix:修复测距页面标题展示问题

This commit is contained in:
2026-05-13 15:40:12 +08:00
parent c3570afeba
commit 6db2142cf6
2 changed files with 6 additions and 2 deletions

View File

@@ -105,8 +105,9 @@ watch(() => store.game.totalShot, (newVal) => {
// 监听 Pinia store 中 tips 变化,用于比赛恢复时同步提示文案(替代 uni.$emit 避免时序问题)
// 使用 immediate: true 确保组件创建时立即读取 store 当前值(解决 onShow 早于 onMounted 导致 uni.$emit 事件丢失的问题)
// 注意:使用 != null 而非 if(newVal),确保空字符串 "" 也能触发清空(避免重新开赛时旧文案残留)
watch(() => store.game.tips, (newVal) => {
if (newVal) {
if (newVal != null) {
tips.value = newVal;
}
}, { immediate: true });