Skip to main content

ion-router-link

shadow

路由链接组件用于导航到指定的链接。类似于浏览器的锚标签,它可以接受用于位置的 href,以及用于过渡动画的方向。

🌐 The router link component is used for navigating to a specified link. Similar to the browser's anchor tag, it can accept a href for the location, and a direction for the transition animation.

note

注意:此组件应仅用于原生和Stencil JavaScript项目。对于Angular项目,请使用带有Angular路由的 <a> 和 routerLink。

有关更多信息,请参阅路由文档。

🌐 See the Router documentation for more information.

属性​

🌐 Properties

color​

DescriptionThe color to use from your application's color palette. Default options are: "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", and "dark". For more information on colors, see theming.
Attributecolor
Type"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined
Defaultundefined

href​

DescriptionContains a URL or a URL fragment that the hyperlink points to. If this property is set, an anchor tag will be rendered.
Attributehref
Typestring | undefined
Defaultundefined

rel​

DescriptionSpecifies the relationship of the target object to the link object. The value is a space-separated list of link types.
Attributerel
Typestring | undefined
Defaultundefined

routerAnimation​

DescriptionWhen using a router, it specifies the transition animation when navigating to another page using href.
Attributeundefined
Type((baseEl: any, opts?: any) => Animation) | undefined
Defaultundefined

routerDirection​

DescriptionWhen using a router, it specifies the transition direction when navigating to another page using href.
Attributerouter-direction
Type"back" | "forward" | "root"
Default'forward'

target​

DescriptionSpecifies where to display the linked URL. Only applies when an href is provided. Special keywords: "_blank", "_self", "_parent", "_top".
Attributetarget
Typestring | undefined
Defaultundefined

事件​

🌐 Events

No events available for this component.

方法​

🌐 Methods

No public methods available for this component.

CSS 阴影部分​

🌐 CSS Shadow Parts

No CSS shadow parts available for this component.

CSS 自定义属性​

🌐 CSS Custom Properties

NameDescription
--backgroundBackground of the router link
--colorText color of the router link

插槽​

🌐 Slots

No slots available for this component.