Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
c3e1a39a
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看板
未验证
提交
c3e1a39a
编写于
4月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3505 修复formHost资料部分描述错误
Merge pull request !3505 from yangzk/rk_dev
上级
31930af3
b8553c91
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
116 addition
and
118 deletion
+116
-118
zh-cn/application-dev/reference/apis/js-apis-formhost.md
zh-cn/application-dev/reference/apis/js-apis-formhost.md
+116
-118
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-formhost.md
浏览文件 @
c3e1a39a
...
@@ -29,10 +29,10 @@ SystemCapability.Ability.Form
...
@@ -29,10 +29,10 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识 |
| formId | string | 是 | 卡片标识 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -72,7 +72,7 @@ SystemCapability.Ability.Form
...
@@ -72,7 +72,7 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
deleteForm
(
formId
).
catch
((
error
)
=>
{
formHost
.
deleteForm
(
formId
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
deleteForm, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
deleteForm, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -88,10 +88,10 @@ SystemCapability.Ability.Form
...
@@ -88,10 +88,10 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识 |
| formId | string | 是 | 卡片标识 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -116,11 +116,11 @@ SystemCapability.Ability.Form
...
@@ -116,11 +116,11 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ------ | ---- | ----------- |
| -------------- | ------ | ---- | ----------- |
| formId | string | 是 | 卡片标识 |
| formId | string | 是 | 卡片标识 |
| isReleaseCache | boolean | 是 | 是否释放缓存 |
| isReleaseCache | boolean | 是 | 是否释放缓存 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -161,7 +161,7 @@ SystemCapability.Ability.Form
...
@@ -161,7 +161,7 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
releaseForm
(
formId
,
true
).
catch
((
error
)
=>
{
formHost
.
releaseForm
(
formId
,
true
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
releaseForm, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
releaseForm, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -177,10 +177,10 @@ SystemCapability.Ability.Form
...
@@ -177,10 +177,10 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识 |
| formId | string | 是 | 卡片标识 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -220,7 +220,7 @@ SystemCapability.Ability.Form
...
@@ -220,7 +220,7 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
requestForm
(
formId
).
catch
((
error
)
=>
{
formHost
.
requestForm
(
formId
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
requestForm, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
requestForm, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -236,10 +236,10 @@ SystemCapability.Ability.Form
...
@@ -236,10 +236,10 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识 |
| formId | string | 是 | 卡片标识 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -279,13 +279,13 @@ SystemCapability.Ability.Form
...
@@ -279,13 +279,13 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
castTempForm
(
formId
).
catch
((
error
)
=>
{
formHost
.
castTempForm
(
formId
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
castTempForm, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
castTempForm, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
## notifyVisibleForms
## notifyVisibleForms
notifyVisibleForms(formId
: string
, callback: AsyncCallback
<
void
>
): void;
notifyVisibleForms(formId
s: Array
<
string
>
, callback: AsyncCallback
<
void
>
): void;
向卡片框架发送通知以使指定的卡片可见。该方法调用成功后,会调用onVisibilityChange通知卡片提供方。
向卡片框架发送通知以使指定的卡片可见。该方法调用成功后,会调用onVisibilityChange通知卡片提供方。
...
@@ -295,10 +295,10 @@ SystemCapability.Ability.Form
...
@@ -295,10 +295,10 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识
|
| formIds | Array
<
string
>
| 是 | 卡片标识列表
|
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -313,7 +313,7 @@ SystemCapability.Ability.Form
...
@@ -313,7 +313,7 @@ SystemCapability.Ability.Form
## notifyVisibleForms
## notifyVisibleForms
notifyVisibleForms(formId
: string
): Promise
<
void
>
;
notifyVisibleForms(formId
s: Array
<
string
>
): Promise
<
void
>
;
向卡片框架发送通知以使指定的卡片可见。该方法调用成功后,会调用onVisibilityChange通知卡片提供方。
向卡片框架发送通知以使指定的卡片可见。该方法调用成功后,会调用onVisibilityChange通知卡片提供方。
...
@@ -323,9 +323,9 @@ SystemCapability.Ability.Form
...
@@ -323,9 +323,9 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识
|
| formIds | Array
<
string
>
| 是 | 卡片标识列表
|
**返回值:**
**返回值:**
...
@@ -338,13 +338,13 @@ SystemCapability.Ability.Form
...
@@ -338,13 +338,13 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
notifyVisibleForms
(
formId
).
catch
((
error
)
=>
{
formHost
.
notifyVisibleForms
(
formId
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
notifyVisibleForms, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
notifyVisibleForms, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
## notifyInvisibleForms
## notifyInvisibleForms
notifyInvisibleForms(formId
: string
, callback: AsyncCallback
<
void
>
): void;
notifyInvisibleForms(formId
s: Array
<
string
>
, callback: AsyncCallback
<
void
>
): void;
向卡片框架发送通知以使指定的卡片不可见。该方法调用成功后,会调用onVisibilityChange通知卡片提供方。
向卡片框架发送通知以使指定的卡片不可见。该方法调用成功后,会调用onVisibilityChange通知卡片提供方。
...
@@ -354,10 +354,10 @@ SystemCapability.Ability.Form
...
@@ -354,10 +354,10 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识
|
| formIds | Array
<
string
>
| 是 | 卡片标识列表
|
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -372,7 +372,7 @@ SystemCapability.Ability.Form
...
@@ -372,7 +372,7 @@ SystemCapability.Ability.Form
## notifyInvisibleForms
## notifyInvisibleForms
notifyInvisibleForms(formId
: string
): Promise
<
void
>
;
notifyInvisibleForms(formId
s: Array
<
string
>
): Promise
<
void
>
;
向卡片框架发送通知以使指定的卡片不可见。该方法调用成功后,会调用onVisibilityChange通知卡片提供方。
向卡片框架发送通知以使指定的卡片不可见。该方法调用成功后,会调用onVisibilityChange通知卡片提供方。
...
@@ -382,9 +382,9 @@ SystemCapability.Ability.Form
...
@@ -382,9 +382,9 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识
|
| formIds | Array
<
string
>
| 是 | 卡片标识列表
|
**返回值:**
**返回值:**
...
@@ -397,13 +397,13 @@ SystemCapability.Ability.Form
...
@@ -397,13 +397,13 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
notifyInvisibleForms
(
formId
).
catch
((
error
)
=>
{
formHost
.
notifyInvisibleForms
(
formId
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
notifyInvisibleForms, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
notifyInvisibleForms, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
## enableFormsUpdate
## enableFormsUpdate
enableFormsUpdate(formId
: string
, callback: AsyncCallback
<
void
>
): void;
enableFormsUpdate(formId
s: Array
<
string
>
, callback: AsyncCallback
<
void
>
): void;
向卡片框架发送通知以使指定的卡片可以更新。该方法调用成功后,卡片刷新状态设置为使能,卡片可以接收来自卡片提供方的更新。
向卡片框架发送通知以使指定的卡片可以更新。该方法调用成功后,卡片刷新状态设置为使能,卡片可以接收来自卡片提供方的更新。
...
@@ -413,10 +413,10 @@ SystemCapability.Ability.Form
...
@@ -413,10 +413,10 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识
|
| formIds | Array
<
string
>
| 是 | 卡片标识列表
|
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -431,7 +431,7 @@ SystemCapability.Ability.Form
...
@@ -431,7 +431,7 @@ SystemCapability.Ability.Form
## enableFormsUpdate
## enableFormsUpdate
enableFormsUpdate(formId
: string
): Promise
<
void
>
;
enableFormsUpdate(formId
s: Array
<
string
>
): Promise
<
void
>
;
向卡片框架发送通知以使指定的卡片可以更新。该方法调用成功后,卡片刷新状态设置为使能,卡片可以接收来自卡片提供方的更新。
向卡片框架发送通知以使指定的卡片可以更新。该方法调用成功后,卡片刷新状态设置为使能,卡片可以接收来自卡片提供方的更新。
...
@@ -441,9 +441,9 @@ SystemCapability.Ability.Form
...
@@ -441,9 +441,9 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识
|
| formIds | Array
<
string
>
| 是 | 卡片标识列表
|
**返回值:**
**返回值:**
...
@@ -456,13 +456,13 @@ SystemCapability.Ability.Form
...
@@ -456,13 +456,13 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
enableFormsUpdate
(
formId
).
catch
((
error
)
=>
{
formHost
.
enableFormsUpdate
(
formId
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
enableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
enableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
## disableFormsUpdate
## disableFormsUpdate
disableFormsUpdate(formId
: string
, callback: AsyncCallback
<
void
>
): void;
disableFormsUpdate(formId
s: Array
<
string
>
, callback: AsyncCallback
<
void
>
): void;
向卡片框架发送通知以使指定的卡片不可以更新。该方法调用成功后,卡片刷新状态设置为去使能,卡片不可以接收来自卡片提供方的更新。
向卡片框架发送通知以使指定的卡片不可以更新。该方法调用成功后,卡片刷新状态设置为去使能,卡片不可以接收来自卡片提供方的更新。
...
@@ -472,10 +472,10 @@ SystemCapability.Ability.Form
...
@@ -472,10 +472,10 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识
|
| formIds | Array
<
string
>
| 是 | 卡片标识列表
|
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -490,7 +490,7 @@ SystemCapability.Ability.Form
...
@@ -490,7 +490,7 @@ SystemCapability.Ability.Form
## disableFormsUpdate
## disableFormsUpdate
disableFormsUpdate(formId
: string
): Promise
<
void
>
;
disableFormsUpdate(formId
s: Array
<
string
>
): Promise
<
void
>
;
向卡片框架发送通知以使指定的卡片不可以更新。该方法调用成功后,卡片刷新状态设置为去使能,卡片不可以接收来自卡片提供方的更新。
向卡片框架发送通知以使指定的卡片不可以更新。该方法调用成功后,卡片刷新状态设置为去使能,卡片不可以接收来自卡片提供方的更新。
...
@@ -500,9 +500,9 @@ SystemCapability.Ability.Form
...
@@ -500,9 +500,9 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formId | string | 是 | 卡片标识
|
| formIds | Array
<
string
>
| 是 | 卡片标识列表
|
**返回值:**
**返回值:**
...
@@ -515,7 +515,7 @@ SystemCapability.Ability.Form
...
@@ -515,7 +515,7 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
disableFormsUpdate
(
formId
).
catch
((
error
)
=>
{
formHost
.
disableFormsUpdate
(
formId
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
disableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
disableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -531,9 +531,9 @@ SystemCapability.Ability.Form
...
@@ -531,9 +531,9 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -567,7 +567,7 @@ SystemCapability.Ability.Form
...
@@ -567,7 +567,7 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
isSystemReady
().
catch
((
error
)
=>
{
formHost
.
isSystemReady
().
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
isSystemReady, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
isSystemReady, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -617,7 +617,7 @@ SystemCapability.Ability.Form
...
@@ -617,7 +617,7 @@ SystemCapability.Ability.Form
```
js
```
js
formHost
.
getAllFormsInfo
().
catch
((
error
)
=>
{
formHost
.
getAllFormsInfo
().
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
getAllFormsInfo, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
getAllFormsInfo, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -641,7 +641,7 @@ SystemCapability.Ability.Form
...
@@ -641,7 +641,7 @@ SystemCapability.Ability.Form
**示例:**
**示例:**
```
js
```
js
formHost
.
getFormsInfo
(
"
com.example.ohos.
account
jsdemo
"
,
(
error
,
data
)
=>
{
formHost
.
getFormsInfo
(
"
com.example.ohos.
form
jsdemo
"
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
'
formHost getFormsInfo, error:
'
+
error
.
code
);
console
.
log
(
'
formHost getFormsInfo, error:
'
+
error
.
code
);
}
}
...
@@ -669,7 +669,7 @@ SystemCapability.Ability.Form
...
@@ -669,7 +669,7 @@ SystemCapability.Ability.Form
**示例:**
**示例:**
```
js
```
js
formHost
.
getFormsInfo
(
"
com.example.ohos.
accountjsdemo
"
,
(
error
,
data
)
=>
{
formHost
.
getFormsInfo
(
"
com.example.ohos.
formjsdemo
"
,
"
entry
"
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
'
formHost getFormsInfo, error:
'
+
error
.
code
);
console
.
log
(
'
formHost getFormsInfo, error:
'
+
error
.
code
);
}
}
...
@@ -702,8 +702,8 @@ SystemCapability.Ability.Form
...
@@ -702,8 +702,8 @@ SystemCapability.Ability.Form
**示例:**
**示例:**
```
js
```
js
formHost
.
get
AllFormsInfo
(
).
catch
((
error
)
=>
{
formHost
.
get
FormsInfo
(
"
com.example.ohos.formjsdemo
"
,
"
entry
"
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider getAll
FormsInfo, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host get
FormsInfo, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -719,10 +719,10 @@ SystemCapability.Ability.Form
...
@@ -719,10 +719,10 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formIds | Array
<
string
>
| 是 |
卡片标识列表 |
| formIds | Array
<
string
>
| 是 | 有效
卡片标识列表 |
| callback | AsyncCallback
<
number
>
| 是 | callback形式返回删除的卡片个数 |
| callback | AsyncCallback
<
number
>
| 是 | callback形式返回删除的卡片个数 |
**示例:**
**示例:**
...
@@ -737,7 +737,7 @@ SystemCapability.Ability.Form
...
@@ -737,7 +737,7 @@ SystemCapability.Ability.Form
## deleteInvalidForms
## deleteInvalidForms
function deleteInvalidForms(formIds: Array<
string>
): Promise
<
number
>
;
function deleteInvalidForms(formIds: Array
<
;
string
>
): Promise
<
number
>
;
根据列表删除应用程序的无效卡片。
根据列表删除应用程序的无效卡片。
...
@@ -747,9 +747,9 @@ SystemCapability.Ability.Form
...
@@ -747,9 +747,9 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formIds | Array
<
string
>
| 是 |
卡片标识列表 |
| formIds | Array
<
string
>
| 是 | 有效
卡片标识列表 |
**返回值:**
**返回值:**
...
@@ -762,7 +762,7 @@ SystemCapability.Ability.Form
...
@@ -762,7 +762,7 @@ SystemCapability.Ability.Form
```
js
```
js
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
formHost
.
deleteInvalidForms
(
formIds
).
catch
((
error
)
=>
{
formHost
.
deleteInvalidForms
(
formIds
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
deleteInvalidForms, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
deleteInvalidForms, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -806,9 +806,9 @@ function acquireFormState(want: Want): Promise<FormStateInfo>;
...
@@ -806,9 +806,9 @@ function acquireFormState(want: Want): Promise<FormStateInfo>;
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formIds | Array
<
string
>
| 是 | 卡片标识列表
|
| want |
[
Want
](
js-apis-featureAbility.md#want
)
| 是 | 查询卡片状态时携带的want信息
|
**返回值:**
**返回值:**
...
@@ -829,7 +829,7 @@ SystemCapability.Ability.Form
...
@@ -829,7 +829,7 @@ SystemCapability.Ability.Form
"
abilityName
"
:
"
com.extreme.test.MainAbility
"
"
abilityName
"
:
"
com.extreme.test.MainAbility
"
};
};
formHost
.
acquireFormState
(
want
).
catch
((
error
)
=>
{
formHost
.
acquireFormState
(
want
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
acquireFormState, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
acquireFormState, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -845,24 +845,23 @@ SystemCapability.Ability.Form
...
@@ -845,24 +845,23 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| type | string | 是 | 填写"formUninstall",表示卡片卸载事件 |
| type | string | 是 | 填写"formUninstall",表示卡片卸载事件 |
| callback | Callback
<
string
>
| 是 | 接口本身调用的
回调方法 |
| callback | Callback
<
string
>
| 是 | 需要注册的事件
回调方法 |
**示例:**
**示例:**
```
js
```
js
formHost
.
on
(
"
formUninstall
"
,
(
error
,
data
)
=>
{
let
callback
=
function
(
formId
)
{
if
(
error
)
{
console
.
log
(
'
formHost on formUninstall, formId:
'
+
formId
);
console
.
log
(
'
formHost on formUninstall, error:
'
+
error
.
code
);
}
}
formHost
.
on
(
"
formUninstall
"
,
callback
);
});
```
```
## off("formUninstall")
## off("formUninstall")
off(type: "formUninstall", callback: Callback
<
string
>
): void;
off(type: "formUninstall", callback
?
: Callback
<
string
>
): void;
取消订阅卡片卸载事件。
取消订阅卡片卸载事件。
...
@@ -872,19 +871,18 @@ SystemCapability.Ability.Form
...
@@ -872,19 +871,18 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| type | string | 是 | 填写"formUninstall",表示卡片卸载事件 |
| type | string | 是 | 填写"formUninstall",表示卡片卸载事件 |
| callback | Callback
<
string
>
| 是 | 接口本身调用的回调方法
|
| callback | Callback
<
string
>
| 否 | 需要注销的事件回调方法。缺省时,表示注销所有已注册事件回调
|
**示例:**
**示例:**
```
js
```
js
formHost
.
off
(
"
formUninstall
"
,
(
error
,
data
)
=>
{
let
callback
=
function
(
formId
)
{
if
(
error
)
{
console
.
log
(
'
formHost on formUninstall, formId:
'
+
formId
);
console
.
log
(
'
formHost off formUninstall, error:
'
+
error
.
code
);
}
}
formHost
.
off
(
"
formUninstall
"
,
callback
);
});
```
```
## notifyFormsVisible
## notifyFormsVisible
...
@@ -899,11 +897,11 @@ SystemCapability.Ability.Form
...
@@ -899,11 +897,11 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formIds | Array
<
string
>
| 是 | 卡片标识列表 |
| formIds | Array
<
string
>
| 是 | 卡片标识列表 |
| isVisible | boolean | 是 | 是否可见 |
| isVisible | boolean | 是 | 是否可见 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -944,7 +942,7 @@ SystemCapability.Ability.Form
...
@@ -944,7 +942,7 @@ SystemCapability.Ability.Form
```
js
```
js
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
formHost
.
notifyFormsVisible
(
formIds
,
true
).
catch
((
error
)
=>
{
formHost
.
notifyFormsVisible
(
formIds
,
true
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
notifyFormsVisible, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
notifyFormsVisible, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -960,11 +958,11 @@ SystemCapability.Ability.Form
...
@@ -960,11 +958,11 @@ SystemCapability.Ability.Form
**参数:**
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| formIds | Array
<
string
>
| 是 | 卡片标识列表 |
| formIds | Array
<
string
>
| 是 | 卡片标识列表 |
| isEnableUpdate | boolean | 是 | 是否使能更新 |
| isEnableUpdate | boolean | 是 | 是否使能更新 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回启动
结果 |
| callback | AsyncCallback
<
void
>
| 是 | callback形式返回
结果 |
**示例:**
**示例:**
...
@@ -1005,6 +1003,6 @@ SystemCapability.Ability.Form
...
@@ -1005,6 +1003,6 @@ SystemCapability.Ability.Form
```
js
```
js
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
formHost
.
notifyFormsEnableUpdate
(
formIds
,
true
).
catch
((
error
)
=>
{
formHost
.
notifyFormsEnableUpdate
(
formIds
,
true
).
catch
((
error
)
=>
{
console
.
log
(
'
form
Provider
notifyFormsEnableUpdate, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
form
Host
notifyFormsEnableUpdate, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录