multi cards
This commit is contained in:
23
app/pages/random.vue
Normal file
23
app/pages/random.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<PlayingCard :card :isFaceUp />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Card } from '~~/types/types'
|
||||
|
||||
const { data: card, pending, error } = await useFetch<Card>('/api/card/random')
|
||||
|
||||
const isFaceUp = ref(false)
|
||||
|
||||
useHead({
|
||||
title: computed(() =>
|
||||
card.value ? `${card.value.artist} - ${card.value.title}` : 'Loading...'
|
||||
)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
isFaceUp.value = true
|
||||
}, 700)
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user