Quiz: Routing and URLs

Please enjoy this self-check quiz to help you identify key concepts, points, and techniques discussed in this section.

What does "routing" refer to?

Associating URLs with the corresponding components in an application. Determining the fastest path from point A to point B. Navigating around the web. Assigning IP addresses. Routing refers to associating URLs with the corresponding components in an application.

What modes can be used to manage URLs in a Vue.js app?

quirksmode standard history hash The two modes for routing supported in Vue.js are "history" and "hash" modes.

Where are the route definitions found in a standard Vue.js project created with the Vue CLI webpack template?

/src/routes.js /src/router.js /src/App.vue /router.js The /src/router.js file contains the route definitions.

Which of the following properties of a route can be used with or router.push()?

name children component path The path and name properties can be used to create a link with or router.push().

In a module import statement using the default webpack configuration, what does the @ symbol stand for?

email repository src/ components The @ symbol stands for src/ in the path to a file.

Nested URLs are defined using which property of the route object?

nested babies children siblings The children property defines views nested in a parent view.

Which parameters are defined in the following route path: '/posts/:slug/page/:pageNum'

slug page pageNum posts The two route parameters defined in this path are slug and pageNum.

What do we need to do to add a new route to our application?

Create the new component file. Add the route to the routes Array. Update all of the other component templates. Provide links or logic to move users to the new location. To add a new route to our application we must create the component that will handle the route, add it to the route definition Array, and provide links or logic to allow our users to find the new location.

What are the advantages of using named routes?

Routes get sad without names. We can alter the paths in our application without editing templates. It's easier to remember names than convoluted paths. It can be difficult to remember parameter ordering in the path. There are many reasons to use named routes over paths. These are just a few of them.

Visit Quiz Online

The quiz on this page has been removed from your PDF or ebook format. You may take the quiz by visiting this book online.

results matching ""

    No results matching ""