File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed
Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ export default function (_Vue, opts = {}) {
5050 } )
5151 }
5252 if ( opts . plugins ) {
53+ // required plugin
5354 Platform . install ( { Quasar } )
55+
5456 Object . keys ( opts . plugins ) . forEach ( key => {
5557 const p = opts . plugins [ key ]
5658 if ( typeof p . install === 'function' ) {
Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ import AppFullscreen from './plugins/app-fullscreen'
33import AppVisibility from './plugins/app-visibility'
44import Cookies from './plugins/cookies'
55import Platform from './plugins/platform'
6- import WebStorage from './plugins/web-storage'
6+ import { LocalStorage , SessionStorage } from './plugins/web-storage'
77
88export {
99 AddressbarColor ,
1010 AppFullscreen ,
1111 AppVisibility ,
1212 Cookies ,
1313 Platform ,
14- WebStorage
14+ LocalStorage ,
15+ SessionStorage
1516}
Original file line number Diff line number Diff line change @@ -160,7 +160,15 @@ export const LocalStorage = {
160160 set : setStorageItem . local ,
161161 remove : removeStorageItem . local ,
162162 clear : clearStorage . local ,
163- isEmpty : storageIsEmpty . local
163+ isEmpty : storageIsEmpty . local ,
164+
165+ __installed : false ,
166+ install ( { Quasar } ) {
167+ if ( this . __installed ) { return }
168+ this . __installed = true
169+
170+ Quasar . localStorage = LocalStorage
171+ }
164172}
165173
166174export const SessionStorage = {
@@ -174,16 +182,13 @@ export const SessionStorage = {
174182 set : setStorageItem . session ,
175183 remove : removeStorageItem . session ,
176184 clear : clearStorage . session ,
177- isEmpty : storageIsEmpty . session
178- }
185+ isEmpty : storageIsEmpty . session ,
179186
180- export default {
181187 __installed : false ,
182188 install ( { Quasar } ) {
183189 if ( this . __installed ) { return }
184190 this . __installed = true
185191
186192 Quasar . sessionStorage = SessionStorage
187- Quasar . localStorage = LocalStorage
188193 }
189194}
You can’t perform that action at this time.
0 commit comments