Introduction

@nuxtjs/composition-api provides a way to use the Vue 3 Composition API with Nuxt-specific features.

@nuxtjs/composition-api provides a way to use the Vue 3 Composition API in with Nuxt-specific features.

Note: the main aim is to allow experimentation and feedback before the final release of Nuxt 3. The API of Nuxt-specific methods will likely change before Nuxt 3 is released.

Key features

Support for the new Nuxt fetch in v2.12+

Easy access to router, app, store within setup()

Interact directly with your vue-meta properties within setup()

Drop-in replacement for ref with automatic SSR stringification and hydration (ssrRef)

Written in TypeScript

API reference

This package extends @vue/composition-api and exports all of its types and methods. You can find a full reference for it in the Vue 3 docs and in the initial Composition API RFC).