Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

Add Programmatic Navigation with navigateTo

In this lesson, you'll implement programmatic navigation in your Nuxt application using navigateTo. You'll create a helper method within the useChats composable to navigate users to a newly created chat. Additionally, you'll update your app header and index page to apply this new method, providing a seamless user experience. You'll also handle scenarios where a chat doesn't exist by adding guards to redirect users appropriately.

Programmatic Navigation: https://nuxt.com/docs/guide/directory-structure/pages#programmatic-navigation

navigateTo: https://nuxt.com/docs/api/utils/navigate-to