Nuxt navigateTo

up:: From the documentation - navigateTo · Nuxt Utils:

<script setup>
// passing 'to' as a string
await navigateTo('/search')
 
// ... or as a route object
await navigateTo({ path: '/search' })
 
// ... or as a route object with query parameters
await navigateTo({
  path: '/search',
  query: {
    page: 1,
    sort: 'asc'
  }
})
</script>

Can also be used in Nuxt Middlewares.