Files
front/components/CardSlot.vue
T
2024-05-03 17:00:31 +02:00

37 lines
760 B
Vue

<script setup lang="ts">
import type { Card } from '~/netcode/Card';
export interface Props {
stack: (Card | null)[]
}
const props = withDefaults(defineProps<Props>(), {
stack: () => [],
})
const unwrapped = ref(false)
</script>
<template>
<div>
<input type="checkbox" v-model="unwrapped" class="checkbox" />
<div class="cards_container">
<template v-if="props.stack.length > 0" v-for="c in props.stack">
<CardPreview :data="c" :wrapped="!unwrapped">
<slot></slot>
</CardPreview>
</template>
</div>
</div>
</template>
<style scoped>
.cards_container {
position: relative;
max-width: 30vw;
grid-auto-columns: auto;
}
</style>