@mudssky/jsutils
    Preparing search index...

    Class UniStorage<T>

    对uniapp的Storage API进行封装,主要是为了提供ts类型提示。

    import { UniStorage } from '@mudssky/jsutils'

    export type GlobalStorageKey = 'userId'

    export const GlobalStorage = new UniStorage<GlobalStorageKey>({
    getStorageSync: uni.getStorageSync,
    setStorageSync: uni.setStorageSync,
    clearStorageSync: uni.clearStorageSync,
    removeStorageSync: uni.removeStorageSync,
    getStorageInfoSync: uni.getStorageInfoSync,
    })

    Type Parameters

    • T extends string = string

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    prefix: string
    Uni: any

    Methods