Storage for User Interface settings. Wrapper around localStorage
It is recommended to use this module instead of direct access to the localStorage
.
User can clear all settings using User menu
-> Reset GUI Settings
.
Module is injected into Vue.prototype
as $uiSettings
and exported as @unitybase/adminui-vue
.uiSettings
// inside vue can be used as this.$uiSettings
// restore some setting
this.videoRatio = this.$uiSettings.get('UFileWebcamButton', 'videoRatio') ?? this.videoRatios[0]
// save setting
this.$uiSettings.put(this.videoRatios[0], 'UFileWebcamButton', 'videoRatio')
// or from adminui-vue exports
const App = require('@unitybase/adminui-vue')
const isCollapsed = App.uiSettings.get('sidebar', 'isCollapsed')
Methods
# createStorageFunctions (storageObj: Storage) → object inner
Create storage functions for a specific storage type
Return:
Object with storage functions
Arguments:
storageObj
: StorageStorage object to use (localStorage or sessionStorage)