ExternalLink 是 WordPress 组件库中的一个 React 组件,用于创建指向外部资源的链接。它基于 HTML 的 标签构建,并接受特定的 props 来配置链接内容和目标 URL。
import { ExternalLink } from '@wordpress/components';
const MyExternalLink = () => (
<ExternalLink href="https://wordpress.org">WordPress.org</ExternalLink>
); Link to an external resource.
import { ExternalLink } from '@wordpress/components';
const MyExternalLink = () => (
<ExternalLink href="https://wordpress.org">WordPress.org</ExternalLink>
);
The component accepts the following props. Any other props will be passed through to the a.
children: ReactNodeThe content to be displayed within the link.
href: stringThe URL of the external resource.