Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
82c2f0f1
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
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看板
未验证
提交
82c2f0f1
编写于
7月 14, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 14, 2023
浏览文件
操作
浏览文件
下载
差异文件
!20705 [新需求]: 新增FormLink组件文档
Merge pull request !20705 from jiangdayuan/master
上级
7fcd9e4e
173c11a4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
105 addition
and
1 deletion
+105
-1
zh-cn/application-dev/reference/arkui-ts/Readme-CN.md
zh-cn/application-dev/reference/arkui-ts/Readme-CN.md
+1
-0
zh-cn/application-dev/reference/arkui-ts/figures/formLink.jpeg
.../application-dev/reference/arkui-ts/figures/formLink.jpeg
+0
-0
zh-cn/application-dev/reference/arkui-ts/ts-components-summary.md
...plication-dev/reference/arkui-ts/ts-components-summary.md
+4
-1
zh-cn/application-dev/reference/arkui-ts/ts-container-formlink.md
...plication-dev/reference/arkui-ts/ts-container-formlink.md
+100
-0
未找到文件。
zh-cn/application-dev/reference/arkui-ts/Readme-CN.md
浏览文件 @
82c2f0f1
...
...
@@ -118,6 +118,7 @@
-
[
Counter
](
ts-container-counter.md
)
-
[
Flex
](
ts-container-flex.md
)
-
[
FlowItem
](
ts-container-flowitem.md
)
-
[
FormLink
](
ts-container-formlink.md
)
-
[
GridCol
](
ts-container-gridcol.md
)
-
[
GridRow
](
ts-container-gridrow.md
)
-
[
Grid
](
ts-container-grid.md
)
...
...
zh-cn/application-dev/reference/arkui-ts/figures/formLink.jpeg
0 → 100644
浏览文件 @
82c2f0f1
16.0 KB
zh-cn/application-dev/reference/arkui-ts/ts-components-summary.md
浏览文件 @
82c2f0f1
...
...
@@ -290,9 +290,12 @@
-
[
RemoteWindow
](
ts-basic-components-remotewindow.md
)
远程控制窗口组件,可以通过此组件控制应用窗口,提供启动退出过程中控件动画和应用窗口联动动画的能力。
-
[
Form
c
omponent
](
ts-basic-components-formcomponent.md
)
-
[
Form
C
omponent
](
ts-basic-components-formcomponent.md
)
提供卡片组件,实现卡片的显示功能。
-
[
FormLink
](
ts-container-formlink.md
)
提供静态卡片事件交互功能。
-
[
Menu
](
ts-basic-components-menu.md
)
以垂直列表形式显示的菜单。
...
...
zh-cn/application-dev/reference/arkui-ts/ts-container-formlink.md
0 → 100644
浏览文件 @
82c2f0f1
# FormLink
提供静态卡片交互组件,用于静态卡片内部和提供方应用间的交互,当前支持router、message和call三种类型的事件。
> **说明:**
>
> - 该组件从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
>
> - 该组件仅可以在静态卡片中使用。
>
## 权限
无
## 子组件
支持单个子组件
## 接口
FormLink(value: {
action: string;
moduleName?: string;
bundleName?: string;
abilityName: string;
params: Object;
})
**参数:**
| 参数名 | 参数类型 | 必填 | 参数描述 |
| ----------- | -------- | ---- | ------------------------------------------------------------ |
| action | string | 是 | action的类型,支持三种预定义的类型:
<br/>
-
"router":跳转到提供方应用的指定UIAbility。
<br/>
-
"message":自定义消息,触发后会调用提供方FormExtensionAbility的[onFormEvent()](../apis/js-apis-app-form-formExtensionAbility.md#onformevent)生命周期回调。
<br/>
-
"call":后台启动提供方应用。触发后会拉起提供方应用的指定UIAbility(仅支持
[
launchType
](
../../application-models/uiability-launch-type.md
)
为singleton的UIAbility,即启动模式为单实例的UIAbility),但不会调度到前台。提供方应用需要具备后台运行权限(
[
ohos.permission.KEEP_BACKGROUND_RUNNING
](
../../security/permission-list.md#ohospermissionkeep_background_running
)
)。 |
| moduleName | string | 否 | "router"
/
"call"
类型时跳转的模块名,可选。 |
| bundleName | string | 否 | "router"
/
"call"
类型时跳转的包名,可选。 |
| abilityName | string | 是 | "router"
/
"call"
类型时跳转的UIAbility名,必填。 |
| params | Object | 是 | 当前action携带的额外参数,内容使用JSON格式的键值对形式。"call"
类型时需填入参数'method',且类型需要为string类型,用于触发UIAbility中对应的方法,必填。 |
## 属性
支持
[
通用属性
](
ts-universal-attributes-size.md
)
## 事件
不支持
[
通用事件
](
ts-universal-events-click.md
)
## 示例
```
ts
@
Entry
@
Component
struct
FormLinkDemo
{
build
()
{
Column
()
{
Text
(
"
这是一个静态卡片
"
).
fontSize
(
20
).
margin
(
10
)
// router事件用于静态卡片跳转到对应的UIAbility
FormLink
({
action
:
"
router
"
,
abilityName
:
"
EntryAbility
"
,
params
:
{
'
message
'
:
'
testForRouter
'
// 自定义要发送的message
}
})
{
Button
(
"
router event
"
).
width
(
120
)
}.
margin
(
10
)
// message事件触发FormExtensionAbility的onFormEvent生命周期
FormLink
({
action
:
"
message
"
,
abilityName
:
"
EntryAbility
"
,
params
:
{
'
message
'
:
'
messageEvent
'
// 自定义要发送的message
}
})
{
Button
(
"
message event
"
).
width
(
120
)
}.
margin
(
10
)
// call事件用于触发UIAbility中对应的方法
FormLink
({
action
:
"
call
"
,
abilityName
:
"
EntryAbility
"
,
params
:
{
'
method
'
:
'
funA
'
,
// 在EntryAbility中调用的方法名
'
num
'
:
1
// 需要传递的其他参数
}
})
{
Button
(
"
call event
"
).
width
(
120
)
}.
margin
(
10
)
}
.
justifyContent
(
FlexAlign
.
Center
)
.
width
(
'
100%
'
).
height
(
'
100%
'
)
}
}
```

\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录