Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/potato4d/nuxt-client-init-module
Provide client version of nuxtServerInit
https://github.com/potato4d/nuxt-client-init-module
module nuxt nuxt-module nuxtjs vue vuejs
Last synced: about 2 months ago
JSON representation
Provide client version of nuxtServerInit
- Host: GitHub
- URL: https://github.com/potato4d/nuxt-client-init-module
- Owner: potato4d
- License: mit
- Created: 2018-07-25T13:57:16.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-31T14:08:34.000Z (about 2 months ago)
- Last Synced: 2024-07-31T17:34:31.224Z (about 2 months ago)
- Topics: module, nuxt, nuxt-module, nuxtjs, vue, vuejs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/nuxt-client-init-module
- Size: 2.11 MB
- Stars: 236
- Watchers: 5
- Forks: 9
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# nuxtClientInit module
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![donate: Patreon](https://img.shields.io/badge/donate-patreon-orange.svg?style=flat-square)](https://www.patreon.com/potato4d)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![NPM version](https://img.shields.io/npm/v/nuxt-client-init-module.svg?style=flat)](https://npmjs.com/package/nuxt-client-init-module)
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors)
[![NPM downloads](https://img.shields.io/npm/dm/nuxt-client-init-module.svg?style=flat)](https://npmjs.com/package/nuxt-client-init-module)
[![codecov](https://codecov.io/gh/potato4d/nuxt-client-init-module/branch/master/graph/badge.svg)](https://codecov.io/gh/potato4d/nuxt-client-init-module)> Provide client version of `nuxtServerInit`.
`nuxt-client-init-module` provides Nuxt.js with the ability to inject processing at client initialization.
Just like `nuxtServerInit`, it is possible to implement the` nuxtClientInit` action, which is executed only on the client-side rendering, in the root Vuex module.## Installation
```bash
$ yarn add nuxt-client-init-module
```## Usage
in nuxt.config.js
```js
{
...
modules: [
'nuxt-client-init-module'
]
...
}
```in store/index.js
```js
export const actions = {
nuxtClientInit({ commit }, context) {
// code
}
}
```**Note:** When working with other modules (e.g. axios) that are needed during `nuxtClientInit`, `nuxt-client-init-module` should appear earlier in the `modules` section of `nuxt.config.js` for correct functionality.
## Author
- [potato4d](https://twitter.com/potato4d)
## LICENSE
MIT
## Contributors
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
HANATANI Takuma
💻 🐛 👀 💬
tosuke
🐛
Masaya Kazama
🐛
Nikita Umnov
💻
Mohammed Sohail
📖
Anton Sitnikov
📖
Simon Eldevig
🐛
Dmitry Belichack
💻
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!