spz-state
When to use
spz-state is a state management component that persists state to localStorage or sessionStorage.
Supported layout
container
Example
Attributes
Methods
getData()
Returns all state data.
Return format:
getState(params?)
Gets the state for a specified state_id. Priority: parameter > component state-id attribute > return all state.
Parameters:
params(optional) — a state_id string or a parameter object{state_id: 'value'}
Return format:
Actions
toggle
Toggle the state of a specified state_id. Priority: parameter > component state-id attribute.
Parameters:
state_id(optional) — the state_id to toggle
Events
Notes
- State is persisted to
localStorageorsessionStoragebased on thestate-typeattribute. - Downstream components can access state via
custom:<id>.getState.