@nuxtjs/composition-api

Composition API hooks for Nuxt
1,254,832 702
Install
npm install @nuxtjs/composition-api
Latest Version:0.34.0
Vue:2
License:MIT
Last Updated:Dec 5, 2024
Links: GitHub  ·  npm

🏗️ Nuxt Composition API

Composition API hooks for Nuxt 2

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


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


Features

  • 🏃 Fetch: Support for the new Nuxt fetch() in v2.12+
  • ℹ️ Context: Easy access to router, app, store within setup()
  • 🗺️ Head: Interact directly with your vue-meta properties within setup()
  • ✨ Automatic hydration: Drop-in replacement for ref with automatic SSR stringification and hydration (ssrRef)
  • 📝 SSR support: Allows using the Composition API with SSR
  • 💪 TypeScript: Written in TypeScript

Read Documentation

Contributors

Contributions are very welcome.

  1. Clone this repo

    git clone git@github.com:nuxt-community/composition-api.git
    
  2. Install dependencies and build project

    yarn
    # Compile library and watch for changes
    yarn watch
    # Start a test Nuxt fixture with hot reloading
    yarn fixture
    # Test
    yarn test
    

Tip: You can also use yarn link to test the module locally with your Nuxt project.

License

MIT License - Copyright © Daniel Roe

Related Packages

vue-sanity

Sanity integration for Vue

6,530 62
comfortable-nuxt

Nuxt Module of the Comfortable Javascript - SDK

1,599 0
vue2-map-chart

VueJS Map Chart

1,013 0
nuxt-esbuild

Nuxt ESBuild module

5,804 67
vue-use-state-effect

Fast and small library built on top of the native Vue.js API, providing a safe a...

13,117 38

Version History

Version Released Vue License
0.34.0 ^2.7.16 MIT
0.33.1 ^2.7.8 MIT
0.33.0 ^2.7.4 MIT
0.32.0 ^2 MIT
0.31.0 ^2 MIT
Pre-releases (3)
Version Released Vue License
0.22.5-beta.0 ^2 MIT
0.21.0-vite-1 ^2 MIT
0.21.0-vite-0 ^2 MIT