更新记录

1.0.0(2019-07-29)

基于uni的本地存储1.0.0初始化


平台兼容性

使用介绍

binerStore是基于存储构造函数构造出来的一个uniStore的一个子类,满足前端的定时缓存功能,对数据的封装

使用方法

  1. 将biner-store文件夹放入components目录中
  2. 在main.js中引入:
    // 引入wTools
    import binerStore from '@/components/biner-store/biner-store'
    // 绑定在vue原型上 全局使用
    Vue.prototype.$binerStore = binerStore;
  3. 然后全局可以使用;

使用实例

  1. 存储 setStorage(key,data,timer)

    this.$binerStore.setStorage(key,data,3000);
  2. 获取 getStorage(key)

    var data = this.$binerStore.getStorage(key);
    if(!data){
        uni.showToast('数据已过期或者没有数据')
    }else{
        console.log(data);
    }
  3. 移除 removeStorage(key)

    this.$binerStore.removeStorage(key);
  1. 清除 clearStorage()
    this.$binerStore.clearStorage();

参数说明

name defalut type 是否必须 common
key String
data String Object
timer timestamp 毫秒数不传是永久

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问