@churchson/q-storage

封装使用的 web storage, 仅在支持 localStorage 和 sessionStorage 使用.

Usage no npm install needed!

<script type="module">
  import churchsonQStorage from 'https://cdn.skypack.dev/@churchson/q-storage';
</script>

README

Churchson 封装的 storage

使用方式

  • 引入 storage

    • import { localSt, sessionSt } from 'storage'
  • 含有方法

    • getItem parmas:key 必填, 读取缓存的 key
    • setItem params: key, value, expireTime 两个必填, 一个选填(key:缓存的键,value:缓存的值, expireTime: 过期时间)
    • clear params:key 选填,不填写,清空所有的缓存