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: 6 days 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 (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-05T12:30:37.000Z (15 days ago)
- Last Synced: 2025-02-08T05:09:19.213Z (13 days ago)
- Topics: module, nuxt, nuxt-module, nuxtjs, vue, vuejs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/nuxt-client-init-module
- Size: 2.02 MB
- Stars: 237
- Watchers: 5
- 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!