Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-admin
Commits
800aad2a
Commit
800aad2a
authored
Dec 22, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加自定义外部容器样式
parent
81c8a0ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
Item.tsx
src/components/AnchorPage/Item.tsx
+10
-2
No files found.
src/components/AnchorPage/Item.tsx
View file @
800aad2a
...
...
@@ -8,14 +8,22 @@ interface AnchorPageItemProps {
* key,实际就是 标签id
*/
itemKey
:
string
,
/**
* 自定义外部样式
*/
customStyle
?:
React
.
HTMLAttributes
<
HTMLDivElement
>
,
/**
* 自定义外部 className
*/
className
?:
string
,
children
?:
React
.
ReactNode
,
}
const
AnchorPageItem
:
React
.
FC
<
AnchorPageItemProps
>
=
(
props
:
AnchorPageItemProps
)
=>
{
const
{
itemKey
,
children
}
=
props
;
const
{
itemKey
,
c
ustomStyle
,
className
,
c
hildren
}
=
props
;
return
(
<
div
id=
{
itemKey
}
>
<
div
id=
{
itemKey
}
style=
{
customStyle
}
className=
{
className
}
>
{
children
}
</
div
>
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment