Nuxt Dynamic Routing and Storyblok Integration
- Group Assignment
- Weight: 30%
- Due: Friday April 8 @ 11:59PM
Morning Javascript: Sort
- Docs
- This method sorts elements in an array.
- With this you can add functionality to sort a list of information by different parameters at the click of a button
Activity
- Sort an array of numbers
- Create an array of numbers
- use sort syntax to order them from lowest to highest
- Sort strings alphabetically
- Add a bunch of words to an array,
- Sort it and return an arranged array to a new variable
Nuxt Router
- We have been learning how to add api's to your router
- Use
$router
syntax to access routes
- Create apis in the server folder and render them as pages
Activities
- Print out information from the router on each page (to test)
- Create an api and navigate to it with the url
localhost:3000/api/route
API Fetching on the Backend
- Create an entry in your api folder and set it up to fetch data from an api
- On a given web page, fetch the content from your api so that you can display it
- When you're comfortable with the API's syntax, try adding an
input
field that uses v-model
to make it responsive to searches
Data Fetching with Storyblok
- When using Nuxt 3, make sure to install storyblok properly
- Use dynamic pages to render your storyblok content
- Follow instructions on these pages for info on doing this in nuxt 3