未验证 提交 ba1625c5 编写于 作者: 葛亚芳 提交者: Gitee

3.2Beta1分支:一致性问题修改 js-apis-data-preferences.md:需同步翻译

Signed-off-by: N@ge-yafang <geyafang@huawei.com>
上级 bd988298
......@@ -262,6 +262,56 @@ promise.then((value) => {
})
```
### getAll
getAll(callback: AsyncCallback&lt;Object&gt;): void;
返回含有所有键值的Object对象。
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;Object&gt; | 是 | 回调函数。返回含有所有键值的Object对象。 |
**示例:**
```ts
preferences.get.getAll(function (err, value) {
if (err) {
console.info("getAll failed, err: " + err)
return
}
let keys = Object.keys(value)
console.info('getAll keys = ' + keys)
console.info("getAll object = " + JSON.stringify(value))
});
```
### getAll
getAll(): Promise&lt;Object&gt;
返回含有所有键值的Object对象。
**系统能力:** SystemCapability.DistributedDataManager.Preferences.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;Object&gt; | Promise对象。返回含有所有键值的Object对象。 |
**示例:**
```ts
let promise = preferences.getAll()
promise.then((value) => {
let keys = Object.keys(value)
console.info('getAll keys = ' + keys)
console.info("getAll object = " + JSON.stringify(value))
}).catch((err) => {
console.info("getAll failed, err: " + err)
})
```
### put
......@@ -289,7 +339,6 @@ preferences.put('startup', 'auto', function (err) {
})
```
### put
put(key: string, value: ValueType): Promise&lt;void&gt;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册