The Single Page and Route Middleware
Discover how to effectively run middleware on selected routes, and learn about the role of the “/single” route.
We'll cover the following...
We'll cover the following...
The modal has a NuxtLink component, which has two tasks. It redirects us to the “/single” URL and also sets the selected image to our state:
Creating the single page
This new route now needs to be handled by adding a new page alongside the existing index.vue:
Let’s look at the following code:
Line 4: We store the selected image information from the
useState.jsfile.Line 9–12: We display the large format image.
Lines 13–14: We display the image author and the image tags. ...