Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
黄庭坚
jinfa-platform
Commits
f63e1b40
Commit
f63e1b40
authored
May 20, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 完善组件
parent
14dae4e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
index.tsx
src/components/AvatarWrap/index.tsx
+11
-3
index.tsx
src/components/ButtonSwitch/index.tsx
+9
-2
index.tsx
src/components/CustomizeColumn/index.tsx
+8
-4
No files found.
src/components/AvatarWrap/index.tsx
View file @
f63e1b40
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-22 11:48:53
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-09-22 11:53:03
* @LastEditTime: 202
1-05-18 17:23:04
* @Description: 详情页头像与名字结合组件
*/
import
React
from
'react'
;
...
...
@@ -10,10 +10,18 @@ import styles from './index.less';
export
interface
AvatarWrapProps
{
info
:
{
aloneTxt
?:
string
,
// 单独显示在头像中间的文件,不传的话从 name 从截取第一个字符
/**
* 单独显示在头像中间的文件,不传的话从 name 从截取第一个字符
*/
aloneTxt
?:
string
,
/**
* 名称
*/
name
:
string
,
level
?:
number
,
};
/**
* 拓展展示
*/
extra
?:
React
.
ReactNode
;
};
...
...
src/components/ButtonSwitch/index.tsx
View file @
f63e1b40
...
...
@@ -2,12 +2,13 @@
* @Author: XieZhiXiong
* @Date: 2021-05-12 11:04:26
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-1
2 11:21:04
* @LastEditTime: 2021-05-1
9 15:59:37
* @Description: 按钮切换器
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Radio
}
from
'antd'
;
import
{
RadioChangeEvent
}
from
'antd/lib/radio'
;
import
{
SizeType
}
from
'antd/lib/config-provider/SizeContext'
;
import
styles
from
'./index.less'
;
export
interface
OptionItem
{
...
...
@@ -34,6 +35,10 @@ interface IProps {
* 值
*/
value
?:
any
,
/**
* Radio.Group size
*/
size
?:
SizeType
,
}
const
ButtonSwitch
:
React
.
FC
<
IProps
>
=
(
props
:
IProps
)
=>
{
...
...
@@ -41,6 +46,7 @@ const ButtonSwitch: React.FC<IProps> = (props: IProps) => {
options
,
onChange
,
value
,
size
,
}
=
props
;
const
first
=
options
.
length
?
options
[
0
].
value
:
''
;
const
[
radioValue
,
setRadioValue
]
=
useState
(
first
);
...
...
@@ -73,7 +79,7 @@ const ButtonSwitch: React.FC<IProps> = (props: IProps) => {
value=
{
radioValue
}
optionType=
"button"
buttonStyle=
"solid"
size=
"small"
size=
{
size
}
/>
</
div
>
);
...
...
@@ -81,6 +87,7 @@ const ButtonSwitch: React.FC<IProps> = (props: IProps) => {
ButtonSwitch
.
defaultProps
=
{
onChange
:
undefined
,
size
:
'small'
,
};
export
default
ButtonSwitch
;
src/components/CustomizeColumn/index.tsx
View file @
f63e1b40
...
...
@@ -32,15 +32,15 @@ export interface DataItem {
columnProps
?:
ColumnProps
,
}
interface
IProps
extends
MellowCardProps
{
export
interface
IProps
extends
MellowCardProps
{
/**
* 数据
*/
data
:
DataItem
[],
/**
* column
* column
列数,默认 3
*/
column
:
number
column
?
:
number
};
const
defaultColumnProps
:
ColumnProps
=
{
...
...
@@ -50,7 +50,7 @@ const defaultColumnProps: ColumnProps = {
};
const
CustomizeColumn
:
React
.
FC
<
IProps
>
=
(
props
:
IProps
)
=>
{
const
{
data
,
column
,
...
rest
}
=
props
;
const
{
data
,
column
=
3
,
...
rest
}
=
props
;
const
{
className
}
=
rest
;
const
mergeCls
=
classNames
(
styles
[
'customize-column'
],
className
);
...
...
@@ -77,4 +77,8 @@ const CustomizeColumn: React.FC<IProps> = (props: IProps) => {
);
};
CustomizeColumn
.
defaultProps
=
{
column
:
3
,
};
export
default
CustomizeColumn
;
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