Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nuxt-community/composition-api

Composition API hooks for Nuxt 2.
https://github.com/nuxt-community/composition-api

composition-api javascript nuxt nuxt-module nuxtjs typescript vue vuejs

Last synced: about 1 month ago
JSON representation

Composition API hooks for Nuxt 2.

Awesome Lists containing this project

README

        

πŸ—οΈ 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](https://nuxt.com/docs/bridge/overview). 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

```bash
git clone [email protected]:nuxt-community/composition-api.git
```

2. Install dependencies and build project

```bash
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](./LICENCE) - Copyright Β© Daniel Roe