Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
a59aff92
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
a59aff92
编写于
6月 29, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6015 Fix spell error of Ability & Notification docs
Merge pull request !6015 from xuzhihao/OpenHarmony-3.1-Release
上级
6eef87b6
109be425
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
15 addition
and
15 deletion
+15
-15
zh-cn/application-dev/reference/apis/js-apis-notification.md
zh-cn/application-dev/reference/apis/js-apis-notification.md
+3
-3
zh-cn/application-dev/reference/apis/js-apis-service-extension-context.md
...n-dev/reference/apis/js-apis-service-extension-context.md
+9
-9
zh-cn/application-dev/reference/apis/js-apis-serviceExtAbilityContext.md
...on-dev/reference/apis/js-apis-serviceExtAbilityContext.md
+3
-3
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-notification.md
浏览文件 @
a59aff92
...
@@ -2525,12 +2525,12 @@ function onConsumeCallback(data) {
...
@@ -2525,12 +2525,12 @@ function onConsumeCallback(data) {
let
wantAgent
=
data
.
wantAgent
;
let
wantAgent
=
data
.
wantAgent
;
wantAgent
.
getWant
(
wantAgent
)
wantAgent
.
getWant
(
wantAgent
)
.
then
((
data1
)
=>
{
.
then
((
data1
)
=>
{
console
.
log
(
'
===> getWant success want:
'
+
JSON
.
stringfy
(
data1
));
console
.
log
(
'
===> getWant success want:
'
+
JSON
.
string
i
fy
(
data1
));
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
console
.
error
(
'
===> getWant failed because
'
+
JSON
.
stringfy
(
err
));
console
.
error
(
'
===> getWant failed because
'
+
JSON
.
string
i
fy
(
err
));
});
});
console
.
info
(
'
===> onConsume callback req.wantAgent:
'
+
JSON
.
stringfy
(
req
.
wantAgent
));
console
.
info
(
'
===> onConsume callback req.wantAgent:
'
+
JSON
.
string
i
fy
(
req
.
wantAgent
));
};
};
var
subscriber
=
{
var
subscriber
=
{
...
...
zh-cn/application-dev/reference/apis/js-apis-service-extension-context.md
浏览文件 @
a59aff92
...
@@ -30,7 +30,7 @@ startAbility(want: Want, callback: AsyncCallback<void>): void;
...
@@ -30,7 +30,7 @@ startAbility(want: Want, callback: AsyncCallback<void>): void;
"
abilityName
"
:
"
com.example.myapp.MyAbility
"
"
abilityName
"
:
"
com.example.myapp.MyAbility
"
};
};
this
.
context
.
startAbility
(
want
,
(
err
)
=>
{
this
.
context
.
startAbility
(
want
,
(
err
)
=>
{
console
.
log
(
'
startAbility result:
'
+
JSON
.
stringfy
(
err
));
console
.
log
(
'
startAbility result:
'
+
JSON
.
string
i
fy
(
err
));
});
});
```
```
...
@@ -63,9 +63,9 @@ startAbility(want: Want): Promise<void>;
...
@@ -63,9 +63,9 @@ startAbility(want: Want): Promise<void>;
"
abilityName
"
:
"
com.example.myapp.MyAbility
"
"
abilityName
"
:
"
com.example.myapp.MyAbility
"
};
};
this
.
context
.
startAbility
(
want
).
then
((
data
)
=>
{
this
.
context
.
startAbility
(
want
).
then
((
data
)
=>
{
console
.
log
(
'
success:
'
+
JSON
.
stringfy
(
data
));
console
.
log
(
'
success:
'
+
JSON
.
string
i
fy
(
data
));
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'
failed:
'
+
JSON
.
stringfy
(
error
));
console
.
log
(
'
failed:
'
+
JSON
.
string
i
fy
(
error
));
});
});
```
```
...
@@ -88,7 +88,7 @@ terminateSelf(callback: AsyncCallback<void>): void;
...
@@ -88,7 +88,7 @@ terminateSelf(callback: AsyncCallback<void>): void;
```
js
```
js
this
.
context
.
terminateSelf
((
err
)
=>
{
this
.
context
.
terminateSelf
((
err
)
=>
{
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
stringfy
(
err
));
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
string
i
fy
(
err
));
});
});
```
```
...
@@ -111,9 +111,9 @@ terminateSelf(): Promise<void>;
...
@@ -111,9 +111,9 @@ terminateSelf(): Promise<void>;
```
js
```
js
this
.
context
.
terminateSelf
(
want
).
then
((
data
)
=>
{
this
.
context
.
terminateSelf
(
want
).
then
((
data
)
=>
{
console
.
log
(
'
success:
'
+
JSON
.
stringfy
(
data
));
console
.
log
(
'
success:
'
+
JSON
.
string
i
fy
(
data
));
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'
failed:
'
+
JSON
.
stringfy
(
error
));
console
.
log
(
'
failed:
'
+
JSON
.
string
i
fy
(
error
));
});
});
```
```
...
@@ -174,7 +174,7 @@ disconnectAbility(connection: number, callback:AsyncCallback<void>): void;
...
@@ -174,7 +174,7 @@ disconnectAbility(connection: number, callback:AsyncCallback<void>): void;
```
js
```
js
this
.
context
.
disconnectAbility
(
connection
,
(
err
)
=>
{
// connection为connectAbility中的返回值
this
.
context
.
disconnectAbility
(
connection
,
(
err
)
=>
{
// connection为connectAbility中的返回值
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
stringfy
(
err
));
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
string
i
fy
(
err
));
});
});
```
```
...
@@ -203,9 +203,9 @@ disconnectAbility(connection: number): Promise<void>;
...
@@ -203,9 +203,9 @@ disconnectAbility(connection: number): Promise<void>;
```
js
```
js
this
.
context
.
disconnectAbility
(
connection
).
then
((
data
)
=>
{
// connection为connectAbility中的返回值
this
.
context
.
disconnectAbility
(
connection
).
then
((
data
)
=>
{
// connection为connectAbility中的返回值
console
.
log
(
'
success:
'
+
JSON
.
stringfy
(
data
));
console
.
log
(
'
success:
'
+
JSON
.
string
i
fy
(
data
));
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'
failed:
'
+
JSON
.
stringfy
(
error
));
console
.
log
(
'
failed:
'
+
JSON
.
string
i
fy
(
error
));
});
});
```
```
...
...
zh-cn/application-dev/reference/apis/js-apis-serviceExtAbilityContext.md
浏览文件 @
a59aff92
...
@@ -239,7 +239,7 @@ terminateSelf(callback: AsyncCallback<void>): void
...
@@ -239,7 +239,7 @@ terminateSelf(callback: AsyncCallback<void>): void
```
js
```
js
this
.
context
.
terminateSelf
((
err
)
=>
{
this
.
context
.
terminateSelf
((
err
)
=>
{
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
stringfy
(
err
));
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
string
i
fy
(
err
));
});
});
```
```
...
@@ -261,9 +261,9 @@ terminateSelf(): Promise<void>
...
@@ -261,9 +261,9 @@ terminateSelf(): Promise<void>
```
js
```
js
this
.
context
.
terminateSelf
(
want
).
then
((
data
)
=>
{
this
.
context
.
terminateSelf
(
want
).
then
((
data
)
=>
{
console
.
log
(
'
success:
'
+
JSON
.
stringfy
(
data
));
console
.
log
(
'
success:
'
+
JSON
.
string
i
fy
(
data
));
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'
failed:
'
+
JSON
.
stringfy
(
error
));
console
.
log
(
'
failed:
'
+
JSON
.
string
i
fy
(
error
));
});
});
```
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录