作为属性使用

默认使用 window.localStorage
如果要使用sessionStorage,请使用store.session

npm i xr-storage --save

...
import store from 'xr-storage'

// 默认使用localStorage 
store.get('testKey')

// 使用sessionStorage
store.session.get('testKey')

store.set


// key 为字符串类型, value为任意类型,
//如果value不存在,将移除这个key
store.set('testKey','testValue')

store.get


// key 为字符串类型
store.get('testKey')

store.getAll


// 返回值为对象
store.getAll()

store.has


// key 为字符串类型,返回值为布尔值
store.has('testKey')

store.remove


// key 为字符串类型
store.remove('testKey')

store.clear


//  清空storage
store.clear()