Introduction

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

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

Nuxt Bridge has now been released in beta. It has full composition API support and it's strongly recommended to use Nuxt Bridge instead, if possible, by following the steps in the Bridge migration guide. Feedback welcome at https://github.com/nuxt-community/composition-api/discussions/585.

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

Use script setup (automatically configured using unplugin-vue2-script-setup)

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).