完成加入,退出房间

This commit is contained in:
kron
2025-08-14 15:24:12 +08:00
parent 6803d0f408
commit 2a9a373743
8 changed files with 138 additions and 57 deletions

View File

@@ -9,17 +9,24 @@ const props = defineProps({
type: Array,
default: () => [],
},
currentShooterId: {
type: Number,
default: "",
},
youTurn: {
type: Boolean,
default: false,
},
});
const players = ref(props.team);
const youTurn = ref(false);
watch(
() => props.youTurn,
() => props.currentShooterId,
(newVal) => {
players.value = props.team;
}
const exit = props.team.some((p) => p.id === newVal);
youTurn.value = !!exit;
},
{ immediate: true }
);
</script>