D
D
Dmitry2018-02-11 13:30:11
JavaScript
Dmitry, 2018-02-11 13:30:11

Implementing unknown routes in nuxtjs?

Let's say I have an application on nuxt.js and there are only 2 files in pages. index and about. Accordingly, they will be available at the addresses / and /about.
In the admin panel, it is possible to create pages, among other things, specifying the address at which the page will be available.
For example, you can create a page with the address contacts. such pages are stored in the database.
The problem is that when nuxt receives the /contacts address, it first checks if there is such a page in pages, and then, if it is not there, it launches a component that would pull the content from the database through the api. It can be simpler: do not check in pages, but just check if the received address is in the array ['index', 'about']
Maybe someone knows how to carry out such a check and connect another component? How is this generally implemented?
Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question