Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
17ebf07a
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
17ebf07a
编写于
1月 15, 2016
作者:
K
kasinooya
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add picture-card demo
上级
12c79214
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
104 addition
and
0 deletion
+104
-0
components/upload/demo/picture-card.md
components/upload/demo/picture-card.md
+103
-0
style/components/upload.less
style/components/upload.less
+1
-0
未找到文件。
components/upload/demo/picture-card.md
0 → 100644
浏览文件 @
17ebf07a
# 图片卡片样式
-
order: 8
上传文件为图片,可展示本地缩略图。
---
````
jsx
import
{
Upload
,
Icon
}
from
'
antd
'
;
const
props
=
{
action
:
'
/upload.do
'
,
listType
:
'
picture-card
'
,
defaultFileList
:
[{
uid
:
-
1
,
name
:
'
xxx.png
'
,
status
:
'
done
'
,
url
:
'
https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png
'
,
thumbUrl
:
'
https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png
'
,
}]
};
ReactDOM
.
render
(
<
div
className
=
"clearfix"
>
<
div
style
=
{
{
float
:
'
left
'
}
}
>
<
Upload
{
...
props
}
>
<
div
className
=
"upload-trigger"
>
<
Icon
type
=
"plus"
/>
<
div
className
=
"upload-trigger-text"
>
上传照片
</
div
>
</
div
>
</
Upload
>
</
div
>
<
a
href
=
"https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png"
target
=
"_blank"
className
=
"upload-example"
>
<
img
src
=
"https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png"
/>
<
span
>
示例
</
span
>
</
a
>
</
div
>
,
mountNode
);
````
````
css
/* 配合样式可以做出上传按钮和示例效果 */
.upload-trigger
{
width
:
96px
;
height
:
96px
;
padding
:
24px
0
;
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
background-color
:
#fbfbfb
;
text-align
:
center
;
cursor
:
pointer
;
}
.upload-trigger
i
{
font-size
:
28px
;
color
:
#999
;
}
.upload-trigger-text
{
margin-top
:
8px
;
font-size
:
12px
;
color
:
#666
;
}
.upload-example
{
position
:
relative
;
display
:
inline-block
;
height
:
96px
;
width
:
96px
;
margin-left
:
8px
;
padding
:
8px
;
border
:
1px
solid
#d9d9d9
;
border-radius
:
6px
;
}
.upload-example
img
{
height
:
78px
;
width
:
78px
;
}
.upload-example
:before
{
position
:
absolute
;
bottom
:
8px
;
left
:
8px
;
content
:
' '
;
width
:
78px
;
height
:
24px
;
background-color
:
#808080
;
opacity
:
.8
;
}
.upload-example
span
{
position
:
absolute
;
bottom
:
8px
;
left
:
8px
;
width
:
78px
;
height
:
24px
;
color
:
#fff
;
line-height
:
24px
;
text-align
:
center
;
}
````
style/components/upload.less
浏览文件 @
17ebf07a
...
...
@@ -7,6 +7,7 @@
> span {
display: block;
width: 100%;
outline: none;
}
input[type="file"] {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录