“c1b78d78a63bd280841de314324d3cd853fb0041”上不存在“...reference/arkui-js/js-components-create-elements.md”
未验证 提交 d1ac47c3 编写于 作者: O openharmony_ci 提交者: Gitee

!3556 修改system.storage文档描述

Merge pull request !3556 from lijuntao/OpenHarmony-3.1-Release
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> >
> - 从API Version 6开始,该接口不再维护,可以使用接口[`@ohos.data.storage`](js-apis-data-storage.md)。 > - 从API Version 6开始,该模块不再维护,可以使用模块[`@ohos.data.storage`](js-apis-data-storage.md)。
> >
> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
## 导入模块 ## 导入模块
``` ```js
import storage from '@system.storage'; import storage from '@system.storage';
``` ```
...@@ -19,7 +19,7 @@ import storage from '@system.storage'; ...@@ -19,7 +19,7 @@ import storage from '@system.storage';
get(Object): void get(Object): void
读取存储的内容 通过索引读取缓存中存储的值
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core **系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
...@@ -29,13 +29,13 @@ get(Object): void ...@@ -29,13 +29,13 @@ get(Object): void
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| key | string | 是 | 内容索引。 | | key | string | 是 | 内容索引。 |
| default | string | 否 | key不存在则返回的默认值。 | | default | string | 否 | key不存在则返回的默认值。 |
| success | Function | 否 | 接口调用成功的回调函数,返回存储的内容。 | | success | Function | 否 | 接口调用成功的回调函数,data为返回key对应的value。 |
| fail | Function | 否 | 接口调用失败的回调函数。 | | fail | Function | 否 | 接口调用失败的回调函数,data为错误信息,code为错误码。 |
| complete | Function | 否 | 接口调用结束的回调函数。 | | complete | Function | 否 | 接口调用结束的回调函数。 |
**示例:** **示例:**
``` ```js
export default { export default {
storageGet() { storageGet() {
storage.get({ storage.get({
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
set(Object): void set(Object): void
修改存储的内容 修改缓存中索引对应的值
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core **系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
...@@ -67,15 +67,15 @@ set(Object): void ...@@ -67,15 +67,15 @@ set(Object): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| key | string | 是 | 要修改的存储内容的索引。 | | key | string | 是 | 要修改的存储的索引。 |
| value | string | | 新值。最大长度128。 | | value | string | | 新值。最大长度128。 |
| success | Function | 否 | 接口调用成功的回调函数。 | | success | Function | 否 | 接口调用成功的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 | | fail | Function | 否 | 接口调用失败的回调函数,data为错误信息,code为错误码。 |
| complete | Function | 否 | 接口调用结束的回调函数。 | | complete | Function | 否 | 接口调用结束的回调函数。 |
**示例:** **示例:**
``` ```js
export default { export default {
storageSet() { storageSet() {
storage.set({ storage.set({
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
clear(Object): void clear(Object): void
清空存储的内容 清空缓存中存储的键值对
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core **系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
...@@ -106,12 +106,12 @@ clear(Object): void ...@@ -106,12 +106,12 @@ clear(Object): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| success | Function | 否 | 接口调用成功的回调函数。 | | success | Function | 否 | 接口调用成功的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 | | fail | Function | 否 | 接口调用失败的回调函数,data为错误信息,code为错误码。 |
| complete | Function | 否 | 接口调用结束的回调函数。 | | complete | Function | 否 | 接口调用结束的回调函数。 |
**示例:** **示例:**
``` ```js
export default { export default {
storageClear() { storageClear() {
storage.clear({ storage.clear({
...@@ -131,7 +131,7 @@ export default { ...@@ -131,7 +131,7 @@ export default {
delete(Object): void delete(Object): void
删除存储的内容 删除缓存中索引对应的键值对
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core **系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
...@@ -141,12 +141,12 @@ delete(Object): void ...@@ -141,12 +141,12 @@ delete(Object): void
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| key | string | 是 | 内容索引。 | | key | string | 是 | 内容索引。 |
| success | Function | 否 | 接口调用成功的回调函数。 | | success | Function | 否 | 接口调用成功的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 | | fail | Function | 否 | 接口调用失败的回调函数,data为错误信息,code为错误码。 |
| complete | Function | 否 | 接口调用结束的回调函数。 | | complete | Function | 否 | 接口调用结束的回调函数。 |
**示例:** **示例:**
``` ```js
export default { export default {
storageDelete() { storageDelete() {
storage.delete({ storage.delete({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册