feature (#2): add joke block component to home page
This commit is contained in:
parent
07b9861415
commit
3ed9a2d57d
25
components/JokeBlock.vue
Normal file
25
components/JokeBlock.vue
Normal 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>
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user