Skip to content

Commit 0380098

Browse files
committed
feat: add AppError component
1 parent dd14aa1 commit 0380098

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

playground/app.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const nuxtifyConfig = useNuxtifyConfig()
44
const dialog = useDialog()
55
const toast = useToast()
6+
const errorMessage = useErrorMessage()
67
78
// Page info
89
useNuxtifySiteTitle()
@@ -11,6 +12,9 @@ useServerSeoMeta({
1112
description: `This is the ${nuxtifyConfig.brand?.name} playground.`,
1213
})
1314
15+
// Component state
16+
errorMessage.value = 'This is an error message.'
17+
1418
// Functions
1519
const clickDialog = () => {
1620
// Dialog
@@ -106,6 +110,16 @@ const clickToast = () => {
106110
</v-col>
107111
</v-row>
108112

113+
<!-- App error -->
114+
<v-row>
115+
<v-col cols="12">
116+
<v-card class="pa-4">
117+
<h2>AppError</h2>
118+
<AppError />
119+
</v-card>
120+
</v-col>
121+
</v-row>
122+
109123
<!-- App logo override -->
110124
<v-row>
111125
<v-col cols="12">
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<script setup lang="ts">
2+
import { useErrorMessage } from '#imports'
3+
4+
const errorMessage = useErrorMessage()
5+
const isDev = import.meta.dev
6+
</script>
7+
8+
<template>
9+
<v-alert
10+
v-if="errorMessage"
11+
type="error"
12+
density="compact"
13+
variant="text"
14+
:icon="false"
15+
class="text-body-2 pa-0"
16+
>
17+
{{ errorMessage }}
18+
19+
<!-- DEBUG -->
20+
<div
21+
v-if="isDev"
22+
class="mt-2"
23+
>
24+
<h2 class="text-h6 text-black">
25+
Debug
26+
</h2>
27+
<pre>{{ errorMessage }}</pre>
28+
</div>
29+
</v-alert>
30+
</template>

0 commit comments

Comments
 (0)