uni-app 数据本地存储

uni-app About 296 words

同步方法

uni.setStorageSync('storage_key', 'hello');

异步方法

uni.setStorage({
    key: 'storage_key',
    data: 'hello',
    success: function () {
        console.log('success');
    }
});

读取

const value = uni.getStorageSync('storage_key');

参考文档

https://uniapp.dcloud.net.cn/api/storage/storage.html

Views: 23 · Posted: 2025-07-29

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh