Question · Vue.js course · Module 10: Vue Router

The useRoute Composable

How do you access the current route's parameters in the Composition API?

Answer options

  • const route = useRoute(); route.params.id
  • this.$route.params.id
  • getRouteParams('id')
  • import { params } from 'vue-router'

You can check the correct answer by solving this task in the CodeWorlds game.