UNPKG
vuejs-local-storage
Version:
latest (2.2.15)
2.2.15
2.2.13
2.2.12
2.2.9
2.2.8
Vue plugin for work with LocalStorage from Vue context
github.com/RobinCK/vue-ls
RobinCK/vue-ls
vuejs-local-storage
/
src
/
localStorage.js
11 lines
(8 loc)
•
270 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
memoryStorage
from
'./memoryStorage'
;
import
{
Storage
}
from
'./storage'
;
const
store =
typeof
window
!==
'undefined'
&&
'localStorage'
in
window
?
window
.
localStorage
: memoryStorage ;
const
storageObject =
new
Storage
(store);
export
default
storageObject;