feat: 修改房间卡片点击行为,卡片默认观战,空椅子入座

This commit is contained in:
2026-06-23 11:18:55 +08:00
parent 2a2c941d32
commit eecec1aae1

View File

@@ -80,7 +80,6 @@ const props = defineProps<{
}>()
const emit = defineEmits<{
(e: 'join', roomId: string): void
(e: 'join-seat', roomId: string, seatIndex: number): void
(e: 'spectate', roomId: string): void
}>()
@@ -143,13 +142,9 @@ const statusLabelClass = computed(() => {
}
})
/** 点击卡片 → 加入或观战 */
/** 点击卡片 → 观战(不直接加入) */
function handleClick() {
if (props.room.status === 'playing') {
emit('spectate', props.room.id)
} else {
emit('join', props.room.id)
}
emit('spectate', props.room.id)
}
/** 点击空椅子 → 指定座位加入 */