- I am trying to build a Master Detail View where list and detail are shown side by side on desktop but on different pages on mobile as shown in the image below
- I may have between 500 to 10000 items on the list to display
- I simulated both approaches with 10000 items, feel free to change the number in server/app.js file
- When I click on an item in the list, I want the URL to change so that I click back button I go to the previous button.
- The page should not reload for doing this and it should be in SSR mode
What have I tried?
Approach 1 Dynamic Routes
Inside pages folder, I put an articles folder and _id.vue file and added a nuxt-link
This setup is VERY VERY slow, takes 20 seconds for the summary to change
Approach 2 Custom @nuxtjs/router module with push
Instead of the default router, I tried using the custom @nuxtjs/module
Links are selected much much faster in this approach and the URL is also changing
However if I click on item 4877, it reloads the page and the scrollbar goes back to the top of the page?
How do I keep the scrollbar wherever it is or PREVENT reloading the page?
Simple Question
- What do I do in SSR mode to change the URL as I select an item in the list without reloading the page?
- Which approach is better?
