nuxt-client-init-module

Provide client version of `nuxtServerInit`.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
nuxt-client-init-module
236150.3.03 years ago6 years agoMinified + gzip package size for nuxt-client-init-module in KB

Readme

nuxtClientInit module
code style: prettier donate: Patreon License: MIT NPM version All Contributors NPM downloads codecov
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

$ yarn add nuxt-client-init-module

Usage

in nuxt.config.js
{
  ...
  modules: [
   'nuxt-client-init-module'
  ]
  ...
}

in store/index.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

LICENSE

MIT

Contributors

Thanks goes to these wonderful people (emoji key):
<td align="center"><a href="https://potato4d.me"><img src="https://avatars0.githubusercontent.com/u/6993514?v=4?s=100" width="100px;" alt=""/><br /><sub><b>HANATANI Takuma</b></sub></a><br /><a href="https://github.com/potato4d/nuxt-client-init-module/commits?author=potato4d" title="Code">💻</a> <a href="https://github.com/potato4d/nuxt-client-init-module/issues?q=author%3Apotato4d" title="Bug reports">🐛</a> <a href="https://github.com/potato4d/nuxt-client-init-module/pulls?q=is%3Apr+reviewed-by%3Apotato4d" title="Reviewed Pull Requests">👀</a> <a href="#question-potato4d" title="Answering Questions">💬</a></td>
<td align="center"><a href="https://github.com/Tosuke"><img src="https://avatars2.githubusercontent.com/u/13393900?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tosuke</b></sub></a><br /><a href="https://github.com/potato4d/nuxt-client-init-module/issues?q=author%3ATosuke" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://miyaoka.github.io/"><img src="https://avatars2.githubusercontent.com/u/1443118?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Masaya Kazama</b></sub></a><br /><a href="https://github.com/potato4d/nuxt-client-init-module/issues?q=author%3Amiyaoka" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/NomNes"><img src="https://avatars2.githubusercontent.com/u/12662211?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nikita Umnov</b></sub></a><br /><a href="https://github.com/potato4d/nuxt-client-init-module/commits?author=NomNes" title="Code">💻</a></td>
<td align="center"><a href="http://kamikazechaser.live"><img src="https://avatars2.githubusercontent.com/u/18488025?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mohammed Sohail</b></sub></a><br /><a href="https://github.com/potato4d/nuxt-client-init-module/commits?author=kamikazechaser" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/colmer"><img src="https://avatars1.githubusercontent.com/u/4122445?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anton Sitnikov</b></sub></a><br /><a href="https://github.com/potato4d/nuxt-client-init-module/commits?author=colmer" title="Documentation">📖</a></td>
<td align="center"><a href="http://simoneldevig.dk/"><img src="https://avatars.githubusercontent.com/u/6176830?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Simon Eldevig</b></sub></a><br /><a href="https://github.com/potato4d/nuxt-client-init-module/issues?q=author%3Asimoneldevig" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/DmitryBelichack"><img src="https://avatars.githubusercontent.com/u/14155180?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dmitry Belichack</b></sub></a><br /><a href="https://github.com/potato4d/nuxt-client-init-module/commits?author=DmitryBelichack" title="Code">💻</a></td>



This project follows the all-contributors specification. Contributions of any kind welcome!