链接
一个处理外部链接的 Link 组件
一个封装你 React 框架中 Link 组件(例如 next/link)的组件,并自动处理文档中的外部链接。~
当检测到外部 URL 时,它使用 <a> 而不是 Link 组件。
🌐 A component that wraps the Link component of your React framework (e.g. next/link) and automatically handles external links in the document.~
When an external URL is detected, it uses <a> instead of the Link Component.
rel 属性是自动生成的。
🌐 The rel property is automatically generated.
使用
🌐 Usage
用法与使用 <a> 相同。
🌐 Usage is the same as using <a>.
import Link from 'fumadocs-core/link';
<Link href="/docs/components">Click Me</Link>外部
🌐 External
你可以通过传入一个 external 属性来强制将 URL 设置为外部链接。
🌐 You can force a URL to be external by passing an external prop.
动态链接
🌐 Dynamic hrefs
你可以通过导入 dynamic-link 来启用动态 href。
🌐 You can enable dynamic hrefs by importing dynamic-link.
import { DynamicLink } from 'fumadocs-core/dynamic-link';
<DynamicLink href="/[lang]/components">Click Me</DynamicLink>Last updated on
