Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 Logo
Theme
Mode
Accessibility
Vuetify

Sign in

Sign in with your preferred provider to access your account.

useStorage API

API reference for the useStorage composable.

Functions

createStorage

(options?: StorageOptions) => E

Creates a new storage instance.

createStorageContext

(_options?: StorageContextOptions) => ContextTrinity<E>

createStoragePlugin

(_options?: StoragePluginOptions) => any

Creates a new storage plugin.

useStorage

(namespace?: string) => E

Returns the current storage instance.

Options

adapter

StorageAdapter

The storage adapter to use. Defaults to localStorage in browser, MemoryAdapter otherwise

prefix

string

The prefix to use for all storage keys. Defaults to 'v0:'

serializer

{ read: (value: string) => unknown; write: (value: unknown) => string; }

Custom serializer for reading and writing values. Defaults to JSON.parse/stringify

Methods

has

(key: string) => boolean

Check if a key exists in storage

get

<T>(key: string, defaultValue?: T) => Ref<T>

Get a reactive ref for a storage key

set

<T>(key: string, value: T) => void

Set a value for a storage key

remove

(key: string) => void

Remove a key from storage

clear

() => void

Clear all keys from storage

Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/