1# Hyperlink
2
3超链接组件,组件宽高范围内点击实现跳转。
4
5>  **说明:**
6>
7>  - 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
8>  - 该组件仅支持与系统浏览器配合使用。
9
10## 需要权限
11
12跳转的目标应用使用网络时,需要申请权限ohos.permission.INTERNET。具体申请方式请参考[声明权限](../../../security/AccessToken/declare-permissions.md)。
13
14## 子组件
15
16可以包含[Image](ts-basic-components-image.md)子组件。
17
18## 接口
19
20Hyperlink(address: string | Resource, content?: string | Resource)
21
22**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
23
24**系统能力:** SystemCapability.ArkUI.ArkUI.Full
25
26**参数:**
27
28| 参数名 | 类型 | 必填 | 说明 |
29| -------- | -------- | -------- | -------- |
30| address | string \| [Resource](ts-types.md#resource) | 是 | Hyperlink组件跳转的网页。 |
31| content | string&nbsp;\|&nbsp;[Resource](ts-types.md#resource) | 否 | Hyperlink组件中超链接显示文本。<br/>**说明:** <br/>组件内有子组件时,不显示超链接文本。 |
32
33## 属性
34
35除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性:
36
37### color
38
39color(value: Color | number | string | Resource)
40
41设置超链接文本的颜色。
42
43**原子化服务API:** 从API version 11开始,该接口支持在原子化服务中使用。
44
45**系统能力:** SystemCapability.ArkUI.ArkUI.Full
46
47**参数:** 
48
49| 参数名 | 类型                                                         | 必填 | 说明               |
50| ------ | ------------------------------------------------------------ | ---- | ------------------ |
51| value  | [Color](ts-appendix-enums.md#color)&nbsp;\|&nbsp;number&nbsp;\|&nbsp;string&nbsp;\|&nbsp;[Resource](ts-types.md#resource) | 是   | 超链接文本的颜色。<br />默认值:'#ff0a59f7' |
52
53## 示例
54
55```ts
56@Entry
57@Component
58struct HyperlinkExample {
59  build() {
60    Column() {
61      Column() {
62        Hyperlink('https://example.com/') {
63          Image($r('app.media.bg'))
64            .width(200)
65            .height(100)
66        }
67      }
68
69      Column() {
70        Hyperlink('https://example.com/', 'Go to the developer website') {
71        }
72        .color(Color.Blue)
73      }
74    }.width('100%').height('100%').justifyContent(FlexAlign.Center)
75  }
76}
77```
78
79![hyperlink](figures/hyperlink.PNG)
80