WebIndex/pages/error/[code].vue

19 lines
296 B
Vue
Raw Normal View History

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