marvin
Best practice for using the Route for storing state
Given a page
/items
which has a grid of the available items fetched from the api, I want a modal for adding/creating a new item.
I would like to make the modal appearance (including transitions, if possible) dependent on the route. The modal should show when the url is /items/create
, and don't show when the url is just /items
.
I looked for a solution, but - maybe because of wrong search terms - found no nice and clean solution. Are there any best practices for this?3 replies
Nuxt environment variables load array of objects
I have a runtimeConfig which includes a list of my projects. They are accessible via NUXT_PUBLIC_PROJECTS env variable. Is it possible to load them directly as an object, or do I have to create a composable useProjects() which returns the projects if they are an array, or parses them via JSON.parse if it is a string?
3 replies