mirror of
https://github.com/zhigang1992/react.git
synced 2026-05-08 21:23:01 +08:00
docs: anchor each doc title
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React from 'react'
|
||||
import { Spacer, Code, useTheme } from 'components'
|
||||
import VirtualAnchor from 'lib/components/anchor'
|
||||
|
||||
export interface AttributesTitleProps {
|
||||
alias?: string
|
||||
@@ -19,7 +20,10 @@ const AttributesTitle: React.FC<React.PropsWithChildren<AttributesTitleProps>> =
|
||||
|
||||
return (
|
||||
<>
|
||||
<h4 className="title"><Code>{children}</Code>{getAlias(alias)}</h4>
|
||||
<h4 className="title">
|
||||
<Code><VirtualAnchor pure>{children}</VirtualAnchor></Code>
|
||||
{getAlias(alias)}
|
||||
</h4>
|
||||
<Spacer y={.6} />
|
||||
|
||||
<style jsx>{`
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useMemo } from 'react'
|
||||
import { Card, Link, Spacer, useTheme } from 'components'
|
||||
import AttributesTitle from './attributes-title'
|
||||
import VirtualAnchor from 'lib/components/anchor'
|
||||
|
||||
export interface AttributesProps {
|
||||
edit: string
|
||||
@@ -17,7 +18,7 @@ const Attributes: React.FC<React.PropsWithChildren<AttributesProps>> = React.mem
|
||||
return (
|
||||
<>
|
||||
<Spacer y={5} />
|
||||
<h3>Attributes</h3>
|
||||
<h3><VirtualAnchor>Attributes</VirtualAnchor></h3>
|
||||
<Card className="attr">
|
||||
{children}
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user