feat: 修改房间卡片点击行为,卡片默认观战,空椅子入座
This commit is contained in:
@@ -80,7 +80,6 @@ const props = defineProps<{
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'join', roomId: string): void
|
|
||||||
(e: 'join-seat', roomId: string, seatIndex: number): void
|
(e: 'join-seat', roomId: string, seatIndex: number): void
|
||||||
(e: 'spectate', roomId: string): void
|
(e: 'spectate', roomId: string): void
|
||||||
}>()
|
}>()
|
||||||
@@ -143,13 +142,9 @@ const statusLabelClass = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 点击卡片 → 加入或观战 */
|
/** 点击卡片 → 观战(不直接加入) */
|
||||||
function handleClick() {
|
function handleClick() {
|
||||||
if (props.room.status === 'playing') {
|
emit('spectate', props.room.id)
|
||||||
emit('spectate', props.room.id)
|
|
||||||
} else {
|
|
||||||
emit('join', props.room.id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 点击空椅子 → 指定座位加入 */
|
/** 点击空椅子 → 指定座位加入 */
|
||||||
|
|||||||
Reference in New Issue
Block a user