Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@jeebey/vue-vcached

plugins4node1ISC1.0.1

基于LocalStorage的vue缓存插件 不支持SSR

readme

vue-vcached

介绍

基于LocalStorage的vue缓存插件 不支持SSR

安装

npm i @jeebey/vue-vcached

使用说明

import Vue from 'vue'
import cache from '@jeebey/vue-vcached'
Vue.use(cache, { prefix: 'develop' })

接口文档

set(key,val,[expire])
get(key)

使用示例

1.保存
  this.$cache.set('abc', { a: 'ddd', b: { k: 'v' } })
  this.$cache.set('abc.b.k', 'abc12345')
  // 带有效时间 3000ms
  this.$cache.set('abc', ['a', 'b', 'c'], 3000)
2.取值
  this.$cache.get('abc')