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

update zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md.

Signed-off-by: N葛亚芳 <geyafang@huawei.com>
上级 78733c82
......@@ -632,7 +632,7 @@ import distributedObject from '@ohos.data.distributedDataObject';
import featureAbility from '@ohos.ability.featureAbility';
// 获取context
let context = featureAbility.getContext();
let g_object = distributedObject.create({name:"Amy", age:18, isVis:false});
let g_object = distributedObject.create(context,{name:"Amy", age:18, isVis:false});
g_object.setSessionId("123456");
g_object.save("local").then((result) => {
console.log("save callback");
......@@ -654,7 +654,7 @@ class MainAbility extends Ability{
context = this.context
}
}
let g_object = distributedObject.create({name:"Amy", age:18, isVis:false});
let g_object = distributedObject.create(context,{name:"Amy", age:18, isVis:false});
g_object.setSessionId("123456");
g_object.save("local").then((result) => {
console.log("save callback");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册