提交 92e92129 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 ba08e657
...@@ -271,9 +271,10 @@ Creates a **KVManager** instance to manage KV stores. ...@@ -271,9 +271,10 @@ Creates a **KVManager** instance to manage KV stores.
Stage model: Stage model:
```js ```js
import AbilityStage from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
let kvManager; let kvManager;
export default class MyAbilityStage extends AbilityStage { export default class EntryAbility extends UIAbility {
onCreate() { onCreate() {
console.log("MyAbilityStage onCreate") console.log("MyAbilityStage onCreate")
let context = this.context let context = this.context
...@@ -294,7 +295,7 @@ export default class MyAbilityStage extends AbilityStage { ...@@ -294,7 +295,7 @@ export default class MyAbilityStage extends AbilityStage {
FA model: FA model:
```js ```js
import featureAbility from '@ohos.ability.featureAbility' import featureAbility from '@ohos.ability.featureAbility';
let kvManager; let kvManager;
let context = featureAbility.getContext() let context = featureAbility.getContext()
const kvManagerConfig = { const kvManagerConfig = {
...@@ -327,7 +328,7 @@ Creates and obtains a distributed KV store. This API uses an asynchronous callba ...@@ -327,7 +328,7 @@ Creates and obtains a distributed KV store. This API uses an asynchronous callba
| -------- | ---------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------- | ---- | ------------------------------------------------------------ |
| storeId | string | Yes | Unique identifier of the KV store. The length cannot exceed [MAX_STORE_ID_LENGTH](#constants).| | storeId | string | Yes | Unique identifier of the KV store. The length cannot exceed [MAX_STORE_ID_LENGTH](#constants).|
| options | [Options](#options) | Yes | Configuration of the KV store to create. | | options | [Options](#options) | Yes | Configuration of the KV store to create. |
| callback | AsyncCallback&lt;T&gt; | Yes | Callback invoked to return the distributed single or device KV store created. | | callback | AsyncCallback&lt;T&gt; | Yes | Callback invoked to return the distributed KV store (**SingleKVStore** or **DeviceKVStore**) instance created.|
**Error codes** **Error codes**
...@@ -384,7 +385,7 @@ Creates and obtains a distributed KV store. This API uses a promise to return th ...@@ -384,7 +385,7 @@ Creates and obtains a distributed KV store. This API uses a promise to return th
| Type | Description | | Type | Description |
| ---------------- | ------------------------------------------------------------ | | ---------------- | ------------------------------------------------------------ |
| Promise&lt;T&gt; | Promise used to return the distributed single or device KV store created.| | Promise&lt;T&gt; | Promise used to return the distributed KV store (**SingleKVStore** or **DeviceKVStore**) instance created.|
**Error codes** **Error codes**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册