vuepress-theme-reco/util/handleKey.js
2019-04-04 18:24:25 +08:00

16 lines
278 B
JavaScript

const key = {
set (val) {
sessionStorage.setItem('key', val)
},
get (key) {
return sessionStorage.getItem(key)
},
remove (key) {
sessionStorage.removeItem(key)
},
isHasKey (keys) {
return keys.indexOf(this.get('key')) > -1
}
}
export default key