For the complete documentation index, see llms.txt. This page is also available as Markdown.

Storage.getItem

功能说明

从移动应用的本地存储中获取字符串数据。当应用关闭后再次启动时仍需要保留数据时使用。如果没有值 null则返回它。

类型

Storage.getItem(key: string): Promise<string | null>;

Params

  • key: string — 用于获取值的键。

Response

如果没有值, null则返回它。

示例代码

JavaScript

import { Storage } from "@apps-in-toss/web-framework";

const value = await Storage.getItem("my-key");
console.log(value); // 'value' 或 null

这有帮助吗?