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

Storage.setItem

功能说明

将字符串数据存储到移动应用的本地存储中。用于即使应用关闭后再次启动,数据也需要保留的情况。

类型

Storage.setItem(key: string, value: string): Promise<void>;

Params

  • key: string — 要保存的键。

  • value: string — 要保存的字符串值。

Response

示例代码

JavaScript

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

await Storage.setItem("my-key", "value");

这有帮助吗?