Menu
CoddyTech

Relative Child Paths

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

A child path without a leading slash is resolved beneath its parent. Under /account, settings produces /account/settings. This keeps the URL structure aligned with the layout hierarchy.

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

A leading slash makes a child path absolute. It can still participate in nested rendering, but its URL no longer includes the parent prefix automatically. Use that advanced behavior deliberately; for ordinary nested sections, relative child segments are clearer.

challenge icon

Challenge

Medium

Repair the studio child paths. Declare rooms and schedule as relative child paths, so their destinations are /studio/rooms and /studio/schedule. The supplied links must show their matching child inside the parent layout, retaining its 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