How to Get URL Query Params in Vue 3 Composition API
In this lesson, we will see how to get URL query params in Vue 3 composition API, let's assume that we are sending a hash as a URL param and we need to get it in the component.
Get the hash from the url query params
So to do that we use 'useRoute' as shown in the code below:
<template>
<div>
{{ hash }}
</div>
</template>
<script setup>
import { useRoute } from "vue-router"
const route = useRoute()
const hash = route.params.hash
</script>
<style>
</style>