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 (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-05-06T13:13:53.000Z (about 2 months ago)
- Last Synced: 2025-05-06T14:36:53.854Z (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: 1.98 MB
- Stars: 237
- Watchers: 4
- Forks: 9
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# nuxtClientInit module
[](https://github.com/prettier/prettier)
[](https://www.patreon.com/potato4d)
[](https://opensource.org/licenses/MIT)
[](https://npmjs.com/package/nuxt-client-init-module)
[](#contributors)
[](https://npmjs.com/package/nuxt-client-init-module)
[](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!