Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
5a069dac
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
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看板
未验证
提交
5a069dac
编写于
6月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5114 Fix abilityName error of ability
Merge pull request !5114 from yuyaozhi/master
上级
4824a9c3
b5d1ecb2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
12 deletion
+13
-12
zh-cn/application-dev/reference/apis/js-apis-Context.md
zh-cn/application-dev/reference/apis/js-apis-Context.md
+2
-1
zh-cn/application-dev/reference/apis/js-apis-ability-context.md
...application-dev/reference/apis/js-apis-ability-context.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-application-ability.md
...ication-dev/reference/apis/js-apis-application-ability.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-service-extension-context.md
...n-dev/reference/apis/js-apis-service-extension-context.md
+3
-3
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-Context.md
浏览文件 @
5a069dac
# Context模块
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在FA模型下使用。
## 导入模块
...
...
zh-cn/application-dev/reference/apis/js-apis-ability-context.md
浏览文件 @
5a069dac
...
...
@@ -55,7 +55,7 @@ startAbility(want: Want, callback: AsyncCallback<void>): void
var
want
=
{
"
deviceId
"
:
""
,
"
bundleName
"
:
"
com.extreme.test
"
,
"
abilityName
"
:
"
com.extreme.test.
MainAbility
"
"
abilityName
"
:
"
MainAbility
"
};
this
.
context
.
startAbility
(
want
,
(
error
)
=>
{
console
.
log
(
"
error.code =
"
+
error
.
code
)
...
...
@@ -85,7 +85,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void&
var
want
=
{
"
deviceId
"
:
""
,
"
bundleName
"
:
"
com.extreme.test
"
,
"
abilityName
"
:
"
com.extreme.test.
MainAbility
"
"
abilityName
"
:
"
MainAbility
"
};
var
options
=
{
windowMode
:
0
,
...
...
@@ -123,7 +123,7 @@ startAbility(want: Want, options?: StartOptions): Promise<void>;
var
want
=
{
"
deviceId
"
:
""
,
"
bundleName
"
:
"
com.extreme.test
"
,
"
abilityName
"
:
"
com.extreme.test.
MainAbility
"
"
abilityName
"
:
"
MainAbility
"
};
var
options
=
{
windowMode
:
0
,
...
...
@@ -374,7 +374,7 @@ startAbilityByCall(want: Want): Promise<Caller>;
onWindowStageCreate
(
windowStage
)
{
this
.
context
.
startAbilityByCall
({
bundleName
:
"
com.example.myservice
"
,
abilityName
:
"
com.example.myservice.
MainAbility
"
,
abilityName
:
"
MainAbility
"
,
deviceId
:
""
}).
then
((
obj
)
=>
{
caller
=
obj
;
...
...
zh-cn/application-dev/reference/apis/js-apis-application-ability.md
浏览文件 @
5a069dac
...
...
@@ -347,7 +347,7 @@ call(method: string, data: rpc.Sequenceable): Promise<void>;
onWindowStageCreate
(
windowStage
)
{
this
.
context
.
startAbilityByCall
({
bundleName
:
"
com.example.myservice
"
,
abilityName
:
"
com.example.myservice.
MainAbility
"
,
abilityName
:
"
MainAbility
"
,
deviceId
:
""
}).
then
((
obj
)
=>
{
caller
=
obj
;
...
...
@@ -420,7 +420,7 @@ callWithResult(method: string, data: rpc.Sequenceable): Promise<rpc.MessagePa
onWindowStageCreate
(
windowStage
)
{
this
.
context
.
startAbilityByCall
({
bundleName
:
"
com.example.myservice
"
,
abilityName
:
"
com.example.myservice.
MainAbility
"
,
abilityName
:
"
MainAbility
"
,
deviceId
:
""
}).
then
((
obj
)
=>
{
caller
=
obj
;
...
...
@@ -459,7 +459,7 @@ release(): void;
onWindowStageCreate
(
windowStage
)
{
this
.
context
.
startAbilityByCall
({
bundleName
:
"
com.example.myservice
"
,
abilityName
:
"
com.example.myservice.
MainAbility
"
,
abilityName
:
"
MainAbility
"
,
deviceId
:
""
}).
then
((
obj
)
=>
{
caller
=
obj
;
...
...
@@ -500,7 +500,7 @@ onRelease(callback: OnReleaseCallBack): void;
onWindowStageCreate
(
windowStage
)
{
this
.
context
.
startAbilityByCall
({
bundleName
:
"
com.example.myservice
"
,
abilityName
:
"
com.example.myservice.
MainAbility
"
,
abilityName
:
"
MainAbility
"
,
deviceId
:
""
}).
then
((
obj
)
=>
{
caller
=
obj
;
...
...
zh-cn/application-dev/reference/apis/js-apis-service-extension-context.md
浏览文件 @
5a069dac
...
...
@@ -36,7 +36,7 @@ startAbility(want: Want, callback: AsyncCallback<void>): void;
onWindowStageCreate
(
windowStage
)
{
let
want
=
{
"
bundleName
"
:
"
com.example.myapp
"
,
"
abilityName
"
:
"
com.example.myapp.
MyAbility
"
};
"
abilityName
"
:
"
MyAbility
"
};
this
.
context
.
startAbility
(
want
,
(
err
)
=>
{
console
.
log
(
'
startAbility result:
'
+
JSON
.
stringify
(
err
));
});
...
...
@@ -74,7 +74,7 @@ startAbility(want: Want): Promise<void>;
onWindowStageCreate
(
windowStage
)
{
let
want
=
{
"
bundleName
"
:
"
com.example.myapp
"
,
"
abilityName
"
:
"
com.example.myapp.
MyAbility
"
"
abilityName
"
:
"
MyAbility
"
};
this
.
context
.
startAbility
(
want
).
then
((
data
)
=>
{
console
.
log
(
'
success:
'
+
JSON
.
stringify
(
data
));
...
...
@@ -175,7 +175,7 @@ connectAbility(want: Want, options: ConnectOptions): number;
```
js
let
want
=
{
"
bundleName
"
:
"
com.example.myapp
"
,
"
abilityName
"
:
"
com.example.myapp.
MyAbility
"
"
abilityName
"
:
"
MyAbility
"
};
let
options
=
{
onConnect
:
function
(
elementName
,
proxy
)
{},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录