-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5b8b98
commit ffc5205
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<h1>{{ statusCode ? `${statusCode} - ` : '' }}{{ statusReason }}</h1> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { status } from '@http-util/status-i18n' | ||
export interface Props { | ||
statusCode?: number | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
statusCode: undefined, | ||
}) | ||
const { locale, t } = useI18n() | ||
// computations | ||
const statusReason = computed(() => { | ||
return status(props.statusCode, locale) || t('error') | ||
}) | ||
</script> | ||
|
||
<i18n lang="yaml"> | ||
de: | ||
error: Fehler | ||
en: | ||
error: Error | ||
</i18n> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<NuxtLayout> | ||
<VioError | ||
:status-code="error?.statusCode ? +error?.statusCode : undefined" | ||
/> | ||
</NuxtLayout> | ||
</template> | ||
<script setup lang="ts"> | ||
export type Error = { statusCode: string } | ||
export interface Props { | ||
error?: Error | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
error: undefined, | ||
}) | ||
useHead({ | ||
title: props.error?.statusCode?.toString(), | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.