Complete the code to import the router composable in Vue.
import { [1] } from 'vue-router';
The useRouter function is imported from vue-router to enable programmatic navigation.
Complete the code to get the router instance inside the setup function.
setup() {
const router = [1]();
return {};
}Inside setup, calling useRouter() returns the router instance for navigation.
Fix the error in the navigation call to go to '/home'.
router.[1]('/home');
The push method is used on the router instance to navigate to a new route programmatically.
Fill both blanks to navigate to a named route with params.
router.[1]({ name: '[2]', params: { id: 123 } });
Use push to navigate and specify the route name as 'user' with params.
Fill all three blanks to navigate with query parameters.
router.[1]({ path: '/search', query: { q: '[2]' }, [3]: {} });
Use push to navigate to '/search' with query 'q' set to 'vue' and include params key.
