Menu
CoddyTech

Default Child Views

Part of the Routing and State section of Coddy's Vue journey. Lesson 22 of 55.

An empty child path provides the default content for the parent location. The record below shows Dashboard when the location is exactly /account, inside AccountLayout.

{path:'/account',component:AccountLayout,children:[
 {path:'',component:Dashboard},
 {path:'settings',component:Settings}
]}

The empty path adds no URL segment. It differs from a child named home, which adds /home to the parent path. A default child lets the layout always offer meaningful content at its own URL without redirecting to another location.

challenge icon

Challenge

Medium

At exactly /studio, show Overview.vue inside the studio layout using an empty child path. Keep the existing rooms and schedule children. Navigating from a child to the parent URL must show Studio overview without removing Studio workspace or resetting the parent visit counter.

Keep the supplied route readout and bootstrap files.

Try it yourself

<!doctype html><html><head><meta charset="UTF-8"><title>Routing practice</title></head><body><div id="app"></div><script type="module" src="./main.js"></script></body></html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Routing and State