Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/nuxt-community/composition-api
- Owner: nuxt-community
- License: mit
- Created: 2020-04-27T19:40:36.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T22:30:09.000Z (7 months ago)
- Last Synced: 2024-04-13T17:54:04.089Z (7 months ago)
- Topics: composition-api, javascript, nuxt, nuxt-module, nuxtjs, typescript, vue, vuejs
- Language: TypeScript
- Homepage: https://composition-api.nuxtjs.org
- Size: 5.84 MB
- Stars: 698
- Watchers: 15
- Forks: 100
- Open Issues: 39
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Code of conduct: CODE_OF_CONDUCT.md
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## 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