feature (#2): add joke block component to home page

This commit is contained in:
Ben Hong 2022-02-22 17:22:13 -08:00
parent 07b9861415
commit 3ed9a2d57d
2 changed files with 30 additions and 1 deletions

25
components/JokeBlock.vue Normal file
View File

@ -0,0 +1,25 @@
<script>
export default {
data: () => ({
joke: '',
}),
async mounted() {
this.joke = await fetch('/api/joke').then((res) => res.json())
},
}
</script>
<template>
<article>
<blockquote>
<p>{{ joke }}</p>
</blockquote>
</article>
</template>
<style scoped>
blockquote {
border-left: 5px solid #ccc;
padding: 0.5rem;
}
</style>

View File

@ -1,6 +1,10 @@
<template> <template>
<FeedbackForm /> <main>
<FeedbackForm />
<JokeBlock />
</main>
</template> </template>
<style> <style>
* { * {
font-family: 'Helvetica', sans-serif; font-family: 'Helvetica', sans-serif;