[Vuejs]-How to programatically redirect to error pages in Nuxt?

-1👍

In your catch you can redirect user to error page by

return this.$nuxt.error({ statusCode: 500, message: 'your error message' })

your error.vue page, you can access it with an error prop like:

<p>{{ error.statusCode }}</p>
<p>{{ error.message }} </p>

i will work fine

Leave a comment