1234567891011121314151617 |
- import Vue from 'vue'
- import { getStorage, setStorage } from '@/utils/storage'
- Vue.prototype.$setStorage = (type, key, value, options) => {
- type = type.slice(1).replace('/', '_')
- setStorage(`${type}_${key}`, value, options)
- }
- Vue.prototype.$getStorage = (type, key) => {
- type = type.slice(1).replace('/', '_')
- return getStorage(`${type}_${key}`)
- }
- Vue.prototype.$removeStorage = (type, key) => {
- type = type.slice(1).replace('/', '_')
- localStorage.removeItem(`zp_${type}_${key}`)
- }
|