From 679873eddc26482db083cfa9622e07eda07ec070 Mon Sep 17 00:00:00 2001 From: wangkai Date: Fri, 8 Jul 2022 10:49:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangkai --- .../apis/js-apis-distributed-data.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md b/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md index 1a07b4271a..bce2591a50 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md +++ b/zh-cn/application-dev/reference/apis/js-apis-distributed-data.md @@ -40,7 +40,7 @@ createKVManager(config: KVManagerConfig, callback: AsyncCallback<KVManager> **示例:** Stage模型下的示例: -```js +```ts import AbilityStage from '@ohos.application.Ability' let kvManager; export default class MyAbilityStage extends AbilityStage { @@ -57,10 +57,10 @@ export default class MyAbilityStage extends AbilityStage { } distributedData.createKVManager(kvManagerConfig, function (err, manager) { if (err) { - console.log("createKVManager err: " + JSON.stringify(err)); + console.log("Failed to create KVManager: " + JSON.stringify(err)); return; } - console.log("createKVManager success"); + console.log("Succeeded in creating KVManager"); kvManager = manager; }); } @@ -85,10 +85,10 @@ export default class MyAbilityStage extends AbilityStage { } distributedData.createKVManager(kvManagerConfig, function (err, manager) { if (err) { - console.log("createKVManager err: " + JSON.stringify(err)); + console.log("Failed to create KVManager: " + JSON.stringify(err)); return; } - console.log("createKVManager success"); + console.log("Succeeded in creating KVManager"); kvManager = manager; }); } @@ -117,7 +117,7 @@ createKVManager(config: KVManagerConfig): Promise<KVManager> **示例:** Stage模型下的示例: -```js +```ts import AbilityStage from '@ohos.application.Ability' let kvManager; export default class MyAbilityStage extends AbilityStage { @@ -134,10 +134,10 @@ export default class MyAbilityStage extends AbilityStage { } distributedData.createKVManager(kvManagerConfig, function (err, manager) { if (err) { - console.log("createKVManager err: " + JSON.stringify(err)); + console.log("Failed to create KVManager: " + JSON.stringify(err)); return; } - console.log("createKVManager success"); + console.log("Succeeded in creating KVManager"); kvManager = manager; }); } @@ -162,10 +162,10 @@ export default class MyAbilityStage extends AbilityStage { } distributedData.createKVManager(kvManagerConfig, function (err, manager) { if (err) { - console.log("createKVManager err: " + JSON.stringify(err)); + console.log("Failed to create KVManager: " + JSON.stringify(err)); return; } - console.log("createKVManager success"); + console.log("Succeeded in creating KVManager"); kvManager = manager; }); } -- GitLab