V
V
Vladimir Golub2021-10-15 16:42:33
Vue.js
Vladimir Golub, 2021-10-15 16:42:33

Is it possible to set an error action in @nuxtjs/router?

I want to implement a similar functionality, if the page is not found in the pages folder, make a request to the redirect api, maybe there will be a value for this page and do it. Where to configure handlers for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Morev, 2021-10-16
@SeaInside

Make a page _.vue, it will be used for all addresses unless there is a more specific rule.
In asyncDatathis page, make a request to the API and, depending on the response, call either ctx.redirector ctx.error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question