完成加入,退出房间
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user