跳到主要内容

eo-link

<eo-link>
Alias: <basic.general-link>

通用链接构件。

Playground

Examples

设置 url 用于单页应用内的链接跳转。

Playground

如果设置了 href,将使用原生 <a> 标签来实现链接跳转,通常用于外链的跳转。

Playground

As text

设置 type="text" 可以将链接以普通文本的样式进行渲染。

Playground

Disabled

Playground

Plain

设置 type="plain" 链接不会拥有额外样式,适合搭配其他构件使用。

Playground

Icon

Playground

Properties

NameDescriptionTypeDefaultRequired
type

链接类型

LinkType "link"
disabled

是否禁用

boolean false
href

设置 href 时将使用原生 <a> 标签,通常用于外链的跳转

string
url

链接地址

ExtendedLocationDescriptor
target

链接跳转目标

Target
showExternalIcon

target 为 _blank 时,是否在后面显示特定图标

boolean
underline

是否显示下划线

boolean
replace

是否使用 history.replace 而不是默认的 history.push

boolean false
icon

图标

GeneralIconProps
danger

是否开启危险状态

boolean
tooltip

文字提示

string
linkStyle

链接样式

React.CSSProperties
themeVariant

主题变体

"default" | "elevo"
textContent

文本内容

string

Slots

NameDescription
(default)

链接内容

Events

NameDescriptionEvent Detail
click

点击

Parts

NameDescription
link

锚元素

Type references

LinkType

"link" | "text" | "plain"

ExtendedLocationDescriptor

string | ExtendedLocationDescriptorObject

ExtendedLocationDescriptorObject

LocationDescriptorObject<NextHistoryState> & { keepCurrentSearch?: boolean | string[] }

Target

"_self" | "_blank" | "_parent" | "_top"