2.0.3 • Published 1 year ago

nuxt-persiststate-with-cookie v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

nuxt-persiststate-with-cookie

A nuxt(2) module to persist vuex state with cookie.

Installation

# yarn
$ yarn add --dev nuxt-persiststate-with-cookie

# npm
$ npm i -D nuxt-persiststate-with-cookie

Usage

There are some ways for using nuxt-persiststate with cookie.

  1. Basic.
// nuxt.config.js

module.exports = {
  // ...

  buildModules: [['nuxt-persiststate-with-cookie']],
}
  1. With configuration parameters.
// nuxt.config.js
module.exports = {
  // ...

  buildModules: [
    [
      'nuxt-persiststate-with-cookie',
      {
        key: 'my-custom_cookie_key',
        // ...
      },
    ],
  ],

  // Or
  persiststate: {
    // your config
  },
}
  1. Apply to a third-party nuxt module via requireModule method.
// ...
moduleObject.requireModule([
  'nuxt-persiststate-with-cookie',
  {
    // your config
  },
])

Options

KeyDefault valueTypeDescription
enabletruebooleanWhether to enable nuxt-persiststate-with-cookie
key__NUXT_PERSISTEDSTATE_VUEX__stringSpecifies the key name used when storing the cookie.
paths['site']string[]Specify the 'state' path to persist. By default, all states under the ~/store/site.ts module will be persisted.
setCookiesOptions{ expires: 365, secure: false }objectSpecifies the configuration object for setting the cookie. For details, see The API of js-cookie.

CHANGE LOG

see CHANGE LOG

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.2.0

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago