📜  js nuxt 读取设置 cookie - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:56.338000             🧑  作者: Mango

代码示例1
//install module
npm i --save cookie-universal-nuxt
//add module
{
  modules: [
    // Simple usage
    'cookie-universal-nuxt',

    // With options
    ['cookie-universal-nuxt', { alias: 'cookiz' }],
 ]
}

//and
//set cookie
this.$cookies.set('cookie-name', 'cookie-value', {
  path: '/',
  maxAge: 60 * 60 * 24 * 7
})
this.$cookies.set('cookie-name', cookieValObject, {
  path: '/',
  maxAge: 60 * 60 * 24 * 7
})