Complete the code to create a Vue page component named HomePage.
<template>
<main>
<h1>Welcome to the [1]</h1>
</main>
</template>
<script setup>
// No script needed for this simple page
</script>The page title should match the component name HomePage to keep it clear and consistent.
Complete the code to define a route path for the About page in Vue Router.
const routes = [
{
path: '[1]',
component: () => import('@/pages/AboutPage.vue')
}
];The route path for the About page should be /about to match the page's purpose and URL.
Fix the error in the Vue Router import statement to correctly import the createRouter function.
import { [1] } from 'vue-router';
The correct function to create a router instance in Vue Router is createRouter.
Fill both blanks to create a dynamic route path and access the route parameter in the component.
<template>
<h2>User ID: {{ $route.params.[1] }}</h2>
</template>
<script setup>
const route = useRoute();
const userId = route.params.[2];
</script>The dynamic route parameter is usually named id and accessed via route.params.id.
Fill all three blanks to define a nested route with a child component and a named view.
const routes = [
{
path: '/dashboard',
component: () => import('@/pages/Dashboard.vue'),
children: [
{
path: '[1]',
components: {
default: () => import('@/pages/DashboardMain.vue'),
[2]: () => import('@/pages/DashboardSidebar.vue')
},
name: '[3]'
}
]
}
];The child route path is main, the named view is sidebar, and the route name is dashboard-child.