Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Coping0606
Docs
提交
d1271d45
D
Docs
项目概览
Coping0606
/
Docs
与 Fork 源项目一致
Fork自
OpenHarmony / Docs
通知
1
Star
1
Fork
0
代码
文件
提交
分支
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d1271d45
编写于
8月 29, 2022
作者:
W
wusongqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs against 8755+8556
Signed-off-by:
N
wusongqing
<
wusongqing@huawei.com
>
上级
fb498bc2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
13 deletion
+13
-13
en/application-dev/ability/stage-ability.md
en/application-dev/ability/stage-ability.md
+5
-5
en/application-dev/reference/apis/js-apis-ability-context.md
en/application-dev/reference/apis/js-apis-ability-context.md
+8
-8
未找到文件。
en/application-dev/ability/stage-ability.md
浏览文件 @
d1271d45
...
...
@@ -86,7 +86,7 @@ To create Page abilities for an application in the stage model, you must impleme
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
"
MainAbility onWindowStageCreate
"
)
windowStage
.
loadContent
(
"
pages/index
"
).
then
((
data
)
=>
{
windowStage
.
loadContent
(
"
pages/index
"
).
then
(()
=>
{
console
.
log
(
"
MainAbility load content succeed
"
)
}).
catch
((
error
)
=>
{
console
.
error
(
"
MainAbility load content failed with error:
"
+
JSON
.
stringify
(
error
))
...
...
@@ -227,8 +227,8 @@ var want = {
"
bundleName
"
:
"
com.example.MyApplication
"
,
"
abilityName
"
:
"
MainAbility
"
};
context
.
startAbility
(
want
).
then
((
data
)
=>
{
console
.
log
(
"
Succeed to start ability
with data:
"
+
JSON
.
stringify
(
data
)
)
context
.
startAbility
(
want
).
then
(()
=>
{
console
.
log
(
"
Succeed to start ability
"
)
}).
catch
((
error
)
=>
{
console
.
error
(
"
Failed to start ability with error:
"
+
JSON
.
stringify
(
error
))
})
...
...
@@ -244,8 +244,8 @@ var want = {
"
bundleName
"
:
"
com.example.MyApplication
"
,
"
abilityName
"
:
"
MainAbility
"
};
context
.
startAbility
(
want
).
then
((
data
)
=>
{
console
.
log
(
"
Succeed to start remote ability
with data:
"
+
JSON
.
stringify
(
data
)
)
context
.
startAbility
(
want
).
then
(()
=>
{
console
.
log
(
"
Succeed to start remote ability
"
)
}).
catch
((
error
)
=>
{
console
.
error
(
"
Failed to start remote ability with error:
"
+
JSON
.
stringify
(
error
))
})
...
...
en/application-dev/reference/apis/js-apis-ability-context.md
浏览文件 @
d1271d45
...
...
@@ -126,7 +126,7 @@ var options = {
windowMode
:
0
,
};
this
.
context
.
startAbility
(
want
,
options
)
.
then
((
data
)
=>
{
.
then
(()
=>
{
console
.
log
(
'
Operation successful.
'
)
}).
catch
((
error
)
=>
{
console
.
log
(
'
Operation failed.
'
);
...
...
@@ -273,7 +273,7 @@ var options = {
};
var
accountId
=
11
;
this
.
context
.
startAbility
(
want
,
accountId
,
options
)
.
then
((
data
)
=>
{
.
then
(()
=>
{
console
.
log
(
'
Operation successful.
'
)
}).
catch
((
error
)
=>
{
console
.
log
(
'
Operation failed.
'
);
...
...
@@ -352,7 +352,7 @@ Starts an ability with **options** specified. This API uses a promise to return
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want |
[
Want
](
js-apis-featureAbility.md#Want
)
| Yes| Information about the
**Want**
used for starting an ability.|
| options | StartOptions |
Yes
| Parameters used for starting the ability.|
| options | StartOptions |
No
| Parameters used for starting the ability.|
**Return value**
...
...
@@ -511,8 +511,8 @@ Terminates this ability. This API uses a promise to return the result.
**Example**
```
js
this
.
context
.
terminateSelf
(
want
).
then
((
data
)
=>
{
console
.
log
(
'
success:
'
+
JSON
.
stringify
(
data
)
);
this
.
context
.
terminateSelf
(
want
).
then
(()
=>
{
console
.
log
(
'
success:
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
failed:
'
+
JSON
.
stringify
(
error
));
});
...
...
@@ -571,7 +571,7 @@ this.context.terminateSelfWithResult(
{
want
:
{
bundleName
:
"
com.extreme.myapplication
"
,
abilityName
:
"
MainAbilityDemo
"
},
resultCode
:
100
}).
then
((
result
)
=>
{
}).
then
(()
=>
{
console
.
log
(
"
terminateSelfWithResult
"
)
})
```
...
...
@@ -768,8 +768,8 @@ Sets the label of the ability in the mission. This API uses a promise to return
**Example**
```
js
this
.
context
.
setMissionLabel
(
"
test
"
).
then
((
data
)
=>
{
console
.
log
(
'
success:
'
+
JSON
.
stringify
(
data
)
);
this
.
context
.
setMissionLabel
(
"
test
"
).
then
(()
=>
{
console
.
log
(
'
success:
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
failed:
'
+
JSON
.
stringify
(
error
));
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录