WebIndex/pages/error/[code].vue

20 lines
292 B
Vue
Raw Normal View History

2024-11-17 11:45:08 +08:00
<script setup lang="ts">
const route = useRoute()
2024-12-01 13:09:44 +08:00
const errorCode = parseInt(route.params.code as string, 10)
2024-11-17 11:45:08 +08:00
2024-12-01 13:09:44 +08:00
if (import.meta.server)
throw createError({
statusCode: errorCode,
})
else
showError({statusCode: errorCode})
2024-11-17 11:45:08 +08:00
</script>
<template>
2024-12-01 13:09:44 +08:00
2024-11-17 11:45:08 +08:00
</template>
<style scoped>
</style>