How to decide between Pages, Components and Layouts in Nuxt
up:: Nuxt ⚐
How to decide what to put where
- Default to Nuxt Pages * Get things to work, then get it to work well
- Move common pieces to Nuxt Layouts
- As you notice common code, pull it into Layouts
- “Rule of Three”: You want to see code repeat thrice before adding the abstraction
- Smaller pieces become Vue Components
- Move code from Pages or Templates into new Components
- Components do one thing, Layouts often do multiple things
“Refactor iteratively”