Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
0acd1b8e
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看板
未验证
提交
0acd1b8e
编写于
5月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3744 修改卡片示例
Merge pull request !3744 from 李伟峰/master
上级
e74b6066
3ad03762
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
99 addition
and
55 deletion
+99
-55
zh-cn/application-dev/reference/apis/js-apis-formhost.md
zh-cn/application-dev/reference/apis/js-apis-formhost.md
+89
-49
zh-cn/application-dev/reference/apis/js-apis-formprovider.md
zh-cn/application-dev/reference/apis/js-apis-formprovider.md
+10
-6
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-formhost.md
浏览文件 @
0acd1b8e
...
@@ -39,8 +39,8 @@ SystemCapability.Ability.Form
...
@@ -39,8 +39,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
deleteForm
(
formId
,
(
error
,
data
)
=>
{
formHost
.
deleteForm
(
formId
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost deleteForm, error:
'
+
error
.
code
);
console
.
log
(
'
formHost deleteForm, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -71,7 +71,9 @@ SystemCapability.Ability.Form
...
@@ -71,7 +71,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
deleteForm
(
formId
).
catch
((
error
)
=>
{
formHost
.
deleteForm
(
formId
).
then
(()
=>
{
console
.
log
(
'
formHost deleteForm success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost deleteForm, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost deleteForm, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -98,8 +100,8 @@ SystemCapability.Ability.Form
...
@@ -98,8 +100,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
releaseForm
(
formId
,
(
error
,
data
)
=>
{
formHost
.
releaseForm
(
formId
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost releaseForm, error:
'
+
error
.
code
);
console
.
log
(
'
formHost releaseForm, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -127,8 +129,8 @@ SystemCapability.Ability.Form
...
@@ -127,8 +129,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
releaseForm
(
formId
,
true
,
(
error
,
data
)
=>
{
formHost
.
releaseForm
(
formId
,
true
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost releaseForm, error:
'
+
error
.
code
);
console
.
log
(
'
formHost releaseForm, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -160,7 +162,9 @@ SystemCapability.Ability.Form
...
@@ -160,7 +162,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
releaseForm
(
formId
,
true
).
catch
((
error
)
=>
{
formHost
.
releaseForm
(
formId
,
true
).
then
(()
=>
{
console
.
log
(
'
formHost releaseForm success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost releaseForm, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost releaseForm, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -187,8 +191,8 @@ SystemCapability.Ability.Form
...
@@ -187,8 +191,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
requestForm
(
formId
,
(
error
,
data
)
=>
{
formHost
.
requestForm
(
formId
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost requestForm, error:
'
+
error
.
code
);
console
.
log
(
'
formHost requestForm, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -219,7 +223,9 @@ SystemCapability.Ability.Form
...
@@ -219,7 +223,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
requestForm
(
formId
).
catch
((
error
)
=>
{
formHost
.
requestForm
(
formId
).
then
(()
=>
{
console
.
log
(
'
formHost requestForm success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost requestForm, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost requestForm, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -246,8 +252,8 @@ SystemCapability.Ability.Form
...
@@ -246,8 +252,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
castTempForm
(
formId
,
(
error
,
data
)
=>
{
formHost
.
castTempForm
(
formId
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost castTempForm, error:
'
+
error
.
code
);
console
.
log
(
'
formHost castTempForm, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -278,7 +284,9 @@ SystemCapability.Ability.Form
...
@@ -278,7 +284,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
castTempForm
(
formId
).
catch
((
error
)
=>
{
formHost
.
castTempForm
(
formId
).
then
(()
=>
{
console
.
log
(
'
formHost castTempForm success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost castTempForm, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost castTempForm, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -305,8 +313,8 @@ SystemCapability.Ability.Form
...
@@ -305,8 +313,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
notifyVisibleForms
(
formId
,
(
error
,
data
)
=>
{
formHost
.
notifyVisibleForms
(
formId
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost notifyVisibleForms, error:
'
+
error
.
code
);
console
.
log
(
'
formHost notifyVisibleForms, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -337,7 +345,9 @@ SystemCapability.Ability.Form
...
@@ -337,7 +345,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
notifyVisibleForms
(
formId
).
catch
((
error
)
=>
{
formHost
.
notifyVisibleForms
(
formId
).
then
(()
=>
{
console
.
log
(
'
formHost notifyVisibleForms success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost notifyVisibleForms, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost notifyVisibleForms, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -364,8 +374,8 @@ SystemCapability.Ability.Form
...
@@ -364,8 +374,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
notifyInvisibleForms
(
formId
,
(
error
,
data
)
=>
{
formHost
.
notifyInvisibleForms
(
formId
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost notifyInvisibleForms, error:
'
+
error
.
code
);
console
.
log
(
'
formHost notifyInvisibleForms, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -396,7 +406,9 @@ SystemCapability.Ability.Form
...
@@ -396,7 +406,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
notifyInvisibleForms
(
formId
).
catch
((
error
)
=>
{
formHost
.
notifyInvisibleForms
(
formId
).
then
(()
=>
{
console
.
log
(
'
formHost notifyInvisibleForms success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost notifyInvisibleForms, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost notifyInvisibleForms, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -423,8 +435,8 @@ SystemCapability.Ability.Form
...
@@ -423,8 +435,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
enableFormsUpdate
(
formId
,
(
error
,
data
)
=>
{
formHost
.
enableFormsUpdate
(
formId
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost enableFormsUpdate, error:
'
+
error
.
code
);
console
.
log
(
'
formHost enableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -455,7 +467,9 @@ SystemCapability.Ability.Form
...
@@ -455,7 +467,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
enableFormsUpdate
(
formId
).
catch
((
error
)
=>
{
formHost
.
enableFormsUpdate
(
formId
).
then
(()
=>
{
console
.
log
(
'
formHost enableFormsUpdate success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost enableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost enableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -482,8 +496,8 @@ SystemCapability.Ability.Form
...
@@ -482,8 +496,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
disableFormsUpdate
(
formId
,
(
error
,
data
)
=>
{
formHost
.
disableFormsUpdate
(
formId
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost disableFormsUpdate, error:
'
+
error
.
code
);
console
.
log
(
'
formHost disableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -514,7 +528,9 @@ SystemCapability.Ability.Form
...
@@ -514,7 +528,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
disableFormsUpdate
(
formId
).
catch
((
error
)
=>
{
formHost
.
disableFormsUpdate
(
formId
).
then
(()
=>
{
console
.
log
(
'
formHost disableFormsUpdate success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost disableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost disableFormsUpdate, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -540,8 +556,8 @@ SystemCapability.Ability.Form
...
@@ -540,8 +556,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
isSystemReady
((
error
,
data
)
=>
{
formHost
.
isSystemReady
((
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost isSystemReady, error:
'
+
error
.
code
);
console
.
log
(
'
formHost isSystemReady, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -566,7 +582,9 @@ SystemCapability.Ability.Form
...
@@ -566,7 +582,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formHost
.
isSystemReady
().
catch
((
error
)
=>
{
formHost
.
isSystemReady
().
then
(()
=>
{
console
.
log
(
'
formHost isSystemReady success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost isSystemReady, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost isSystemReady, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -591,8 +609,10 @@ SystemCapability.Ability.Form
...
@@ -591,8 +609,10 @@ SystemCapability.Ability.Form
```
js
```
js
formHost
.
getAllFormsInfo
((
error
,
data
)
=>
{
formHost
.
getAllFormsInfo
((
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost getAllFormsInfo, error:
'
+
error
.
code
);
console
.
log
(
'
formHost getAllFormsInfo, error:
'
+
JSON
.
stringify
(
error
));
}
else
{
console
.
log
(
'
formHost getAllFormsInfo, data:
'
+
JSON
.
stringify
(
data
));
}
}
});
});
```
```
...
@@ -616,7 +636,9 @@ SystemCapability.Ability.Form
...
@@ -616,7 +636,9 @@ SystemCapability.Ability.Form
**示例:**
**示例:**
```
js
```
js
formHost
.
getAllFormsInfo
().
catch
((
error
)
=>
{
formHost
.
getAllFormsInfo
().
then
((
data
)
=>
{
console
.
log
(
'
formHost getAllFormsInfo data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost getAllFormsInfo, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost getAllFormsInfo, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -642,8 +664,10 @@ SystemCapability.Ability.Form
...
@@ -642,8 +664,10 @@ SystemCapability.Ability.Form
```
js
```
js
formHost
.
getFormsInfo
(
"
com.example.ohos.formjsdemo
"
,
(
error
,
data
)
=>
{
formHost
.
getFormsInfo
(
"
com.example.ohos.formjsdemo
"
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost getFormsInfo, error:
'
+
error
.
code
);
console
.
log
(
'
formHost getFormsInfo, error:
'
+
JSON
.
stringify
(
error
));
}
else
{
console
.
log
(
'
formHost getFormsInfo, data:
'
+
JSON
.
stringify
(
data
));
}
}
});
});
```
```
...
@@ -670,8 +694,10 @@ SystemCapability.Ability.Form
...
@@ -670,8 +694,10 @@ SystemCapability.Ability.Form
```
js
```
js
formHost
.
getFormsInfo
(
"
com.example.ohos.formjsdemo
"
,
"
entry
"
,
(
error
,
data
)
=>
{
formHost
.
getFormsInfo
(
"
com.example.ohos.formjsdemo
"
,
"
entry
"
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost getFormsInfo, error:
'
+
error
.
code
);
console
.
log
(
'
formHost getFormsInfo, error:
'
+
JSON
.
stringify
(
error
));
}
else
{
console
.
log
(
'
formHost getFormsInfo, data:
'
+
JSON
.
stringify
(
data
));
}
}
});
});
```
```
...
@@ -702,7 +728,9 @@ SystemCapability.Ability.Form
...
@@ -702,7 +728,9 @@ SystemCapability.Ability.Form
**示例:**
**示例:**
```
js
```
js
formHost
.
getFormsInfo
(
"
com.example.ohos.formjsdemo
"
,
"
entry
"
).
catch
((
error
)
=>
{
formHost
.
getFormsInfo
(
"
com.example.ohos.formjsdemo
"
,
"
entry
"
).
then
((
data
)
=>
{
console
.
log
(
'
formHost getFormsInfo, data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost getFormsInfo, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost getFormsInfo, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -729,8 +757,10 @@ SystemCapability.Ability.Form
...
@@ -729,8 +757,10 @@ SystemCapability.Ability.Form
```
js
```
js
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
formHost
.
deleteInvalidForms
(
formIds
,
(
error
,
data
)
=>
{
formHost
.
deleteInvalidForms
(
formIds
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost deleteInvalidForms, error:
'
+
error
.
code
);
console
.
log
(
'
formHost deleteInvalidForms, error:
'
+
JSON
.
stringify
(
error
));
}
else
{
console
.
log
(
'
formHost deleteInvalidForms, data:
'
+
JSON
.
stringify
(
data
));
}
}
});
});
```
```
...
@@ -761,7 +791,9 @@ SystemCapability.Ability.Form
...
@@ -761,7 +791,9 @@ 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
).
then
((
data
)
=>
{
console
.
log
(
'
formHost deleteInvalidForms, data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost deleteInvalidForms, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost deleteInvalidForms, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -792,8 +824,10 @@ SystemCapability.Ability.Form
...
@@ -792,8 +824,10 @@ SystemCapability.Ability.Form
"
abilityName
"
:
"
com.extreme.test.MainAbility
"
"
abilityName
"
:
"
com.extreme.test.MainAbility
"
};
};
formHost
.
acquireFormState
(
want
,
(
error
,
data
)
=>
{
formHost
.
acquireFormState
(
want
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost acquireFormState, error:
'
+
error
.
code
);
console
.
log
(
'
formHost acquireFormState, error:
'
+
JSON
.
stringify
(
error
));
}
else
{
console
.
log
(
'
formHost acquireFormState, data:
'
+
JSON
.
stringify
(
data
));
}
}
});
});
```
```
...
@@ -828,7 +862,9 @@ SystemCapability.Ability.Form
...
@@ -828,7 +862,9 @@ SystemCapability.Ability.Form
"
bundleName
"
:
"
com.extreme.test
"
,
"
bundleName
"
:
"
com.extreme.test
"
,
"
abilityName
"
:
"
com.extreme.test.MainAbility
"
"
abilityName
"
:
"
com.extreme.test.MainAbility
"
};
};
formHost
.
acquireFormState
(
want
).
catch
((
error
)
=>
{
formHost
.
acquireFormState
(
want
).
then
((
data
)
=>
{
console
.
log
(
'
formHost acquireFormState, data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost acquireFormState, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost acquireFormState, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -908,8 +944,8 @@ SystemCapability.Ability.Form
...
@@ -908,8 +944,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
formHost
.
notifyFormsVisible
(
formIds
,
true
,
(
error
,
data
)
=>
{
formHost
.
notifyFormsVisible
(
formIds
,
true
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost notifyFormsVisible, error:
'
+
error
.
code
);
console
.
log
(
'
formHost notifyFormsVisible, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -941,7 +977,9 @@ SystemCapability.Ability.Form
...
@@ -941,7 +977,9 @@ 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
).
then
(()
=>
{
console
.
log
(
'
formHost notifyFormsVisible success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost notifyFormsVisible, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost notifyFormsVisible, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -969,8 +1007,8 @@ SystemCapability.Ability.Form
...
@@ -969,8 +1007,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
var
formIds
=
new
Array
(
"
12400633174999288
"
,
"
12400633174999289
"
);
formHost
.
notifyFormsEnableUpdate
(
formIds
,
true
,
(
error
,
data
)
=>
{
formHost
.
notifyFormsEnableUpdate
(
formIds
,
true
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formHost notifyFormsEnableUpdate, error:
'
+
error
.
code
);
console
.
log
(
'
formHost notifyFormsEnableUpdate, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -1002,7 +1040,9 @@ SystemCapability.Ability.Form
...
@@ -1002,7 +1040,9 @@ 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
).
then
(()
=>
{
console
.
log
(
'
formHost notifyFormsEnableUpdate success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formHost notifyFormsEnableUpdate, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formHost notifyFormsEnableUpdate, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-formprovider.md
浏览文件 @
0acd1b8e
...
@@ -38,8 +38,8 @@ SystemCapability.Ability.Form
...
@@ -38,8 +38,8 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formProvider
.
setFormNextRefreshTime
(
formId
,
5
,
(
error
,
data
)
=>
{
formProvider
.
setFormNextRefreshTime
(
formId
,
5
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formProvider setFormNextRefreshTime, error:
'
+
error
.
code
);
console
.
log
(
'
formProvider setFormNextRefreshTime, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -71,7 +71,9 @@ SystemCapability.Ability.Form
...
@@ -71,7 +71,9 @@ SystemCapability.Ability.Form
```
js
```
js
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
formProvider
.
setFormNextRefreshTime
(
formId
,
5
).
catch
((
error
)
=>
{
formProvider
.
setFormNextRefreshTime
(
formId
,
5
).
then
(()
=>
{
console
.
log
(
'
formProvider setFormNextRefreshTime success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formProvider setFormNextRefreshTime, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formProvider setFormNextRefreshTime, error:
'
+
JSON
.
stringify
(
error
));
});
});
```
```
...
@@ -101,8 +103,8 @@ SystemCapability.Ability.Form
...
@@ -101,8 +103,8 @@ SystemCapability.Ability.Form
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
let
obj
=
formBindingData
.
createFormBindingData
({
temperature
:
"
22c
"
,
time
:
"
22:00
"
});
let
obj
=
formBindingData
.
createFormBindingData
({
temperature
:
"
22c
"
,
time
:
"
22:00
"
});
formProvider
.
updateForm
(
formId
,
obj
,
(
error
,
data
)
=>
{
formProvider
.
updateForm
(
formId
,
obj
,
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
.
code
)
{
console
.
log
(
'
formProvider updateForm, error:
'
+
error
.
code
);
console
.
log
(
'
formProvider updateForm, error:
'
+
JSON
.
stringify
(
error
)
);
}
}
});
});
```
```
...
@@ -136,7 +138,9 @@ SystemCapability.Ability.Form
...
@@ -136,7 +138,9 @@ SystemCapability.Ability.Form
import
formBindingData
from
'
@ohos.application.formBindingData
'
;
import
formBindingData
from
'
@ohos.application.formBindingData
'
;
var
formId
=
"
12400633174999288
"
;
var
formId
=
"
12400633174999288
"
;
let
obj
=
formBindingData
.
createFormBindingData
({
temperature
:
"
22c
"
,
time
:
"
22:00
"
});
let
obj
=
formBindingData
.
createFormBindingData
({
temperature
:
"
22c
"
,
time
:
"
22:00
"
});
formProvider
.
updateForm
(
formId
,
obj
).
catch
((
error
)
=>
{
formProvider
.
updateForm
(
formId
,
obj
).
then
(()
=>
{
console
.
log
(
'
formProvider updateForm success
'
);
}).
catch
((
error
)
=>
{
console
.
log
(
'
formProvider updateForm, error:
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
formProvider updateForm, 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录