A
A
Alexander2019-06-06 13:19:38
Vue.js
Alexander, 2019-06-06 13:19:38

How to dynamically add a parameter to a route (nuxt)?

Hello. The pages folder has the following structure:
pages/resume/list
When following this route, 10 cards are drawn, and pagination is displayed in the page header. When I click on the second page, I draw the next 10 cards, but this is not reflected in the route. Nuxt builds routes according to the structure in the Pages folder, I don't understand how to add some parameter to the route without changing the folder structure in pages. How do I add a parameter to the route, for example, page=n, where n = the current page, that the address was: ../resume/list/page=n, thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Drozdov, 2019-06-06
@Dgacarda

Nevertheless, https://ru.nuxtjs.org/guide/nested-routes/ is described in the dock.
You create a file _ page.vue and it will be called every time when there is a resume/list/page=n link inside, you get the passed parameter n and draw what did you want

W
WebDev, 2019-06-06
@kirill-93

Another option is to add a get parameter, for example /resume/list?page=2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question