0.3.0 • Published 3 years ago

nuxt-client-init-module v0.3.0

Weekly downloads
7,392
License
MIT
Repository
github
Last release
3 years ago

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 thenuxtClientInit 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):

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

0.3.0

3 years ago

0.2.0

3 years ago

0.1.10

3 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago