41 lines
800 B
Vue
41 lines
800 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 wrapped = ref(false)
|
|
|
|
</script>
|
|
|
|
<template>
|
|
{{ props.stack?.length }}
|
|
<input type="checkbox" v-model="wrapped" />
|
|
<div class="cards_container">
|
|
|
|
<CardPreview v-if="!wrapped && props.stack.length > 0" :data="props.stack.at(-1) ?? null">
|
|
<slot></slot>
|
|
</CardPreview>
|
|
|
|
<template v-if="wrapped" v-for="c in props.stack">
|
|
<CardPreview :data="c">
|
|
<slot></slot>
|
|
</CardPreview>
|
|
</template>
|
|
</div>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
<style scoped>
|
|
.cards_container {
|
|
display: flex;
|
|
flex-direction: row;
|
|
}
|
|
</style> |