Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
e99a7b3d
Commit
e99a7b3d
authored
Aug 17, 2016
by
qingwei.li
Browse files
Options
Browse Files
Download
Plain Diff
Fix conflicts
parents
f8549e90
ebc6be77
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
243 additions
and
1 deletion
+243
-1
components.json
components.json
+3
-0
examples/assets/images/hamburger.png
examples/assets/images/hamburger.png
+0
-0
examples/docs/card.md
examples/docs/card.md
+132
-0
examples/nav.config.json
examples/nav.config.json
+6
-0
packages/card/cooking.conf.js
packages/card/cooking.conf.js
+31
-0
packages/card/index.js
packages/card/index.js
+7
-0
packages/card/package.json
packages/card/package.json
+15
-0
packages/card/src/main.vue
packages/card/src/main.vue
+18
-0
packages/date-picker/src/util/index.js
packages/date-picker/src/util/index.js
+1
-1
packages/theme-default/src/card.css
packages/theme-default/src/card.css
+23
-0
packages/theme-default/src/common/var.css
packages/theme-default/src/common/var.css
+6
-0
packages/theme-default/src/index.css
packages/theme-default/src/index.css
+1
-0
src/utils/date.js
src/utils/date.js
+0
-0
No files found.
components.json
View file @
e99a7b3d
...
@@ -151,5 +151,8 @@
...
@@ -151,5 +151,8 @@
],
],
"badge"
:
[
"badge"
:
[
"./packages/badge/index.js"
"./packages/badge/index.js"
],
"card"
:
[
"./packages/card/index.js"
]
]
}
}
examples/assets/images/hamburger.png
0 → 100644
View file @
e99a7b3d
29.6 KB
examples/docs/card.md
0 → 100644
View file @
e99a7b3d
<script>
import dateUtil from 'main/utils/date'
export default {
data() {
return {
currentDate: dateUtil.format(new Date(), 'yyyy-MM-dd HH:mm')
};
}
}
</script>
<style
scoped
>
.text {
font-size: 14px;
}
.time {
font-size: 13px;
color: #999;
}
.bottom {
margin-top: 13px;
line-height: 12px;
}
.item {
padding: 18px 0;
}
.button {
padding: 0;
float: right;
}
.image {
width: 100%;
display: block;
}
.clearfix {
@utils-clearfix;
}
</style>
## 基础用法
包含标题, 内容和操作
<el-row>
<el-col
:span=
"12"
>
<el-card>
<div
slot=
"header"
class=
"clearfix"
>
<span
style=
"line-height: 36px;"
>
卡片名称
</span>
<el-button
style=
"float: right;"
type=
"primary"
>
操作按钮
</el-button>
</div>
<div
v-for=
"o in 4"
class=
"text item"
>
{{'列表内容 ' + o }}
</div>
</el-card>
</el-col>
</el-row>
```
html
<el-card>
<div
slot=
"header"
class=
"clearfix"
>
<span
style=
"line-height: 36px;"
>
卡片名称
</span>
<el-button
style=
"float: right;"
type=
"primary"
>
操作按钮
</el-button>
</div>
<div
v-for=
"o in 4"
class=
"text item"
>
{{'列表内容 ' + o }}
</div>
</el-card>
```
## 简单卡片
卡片可以只有内容区域
<el-row>
<el-col
:span=
"12"
>
<el-card>
<div
v-for=
"o in 4"
class=
"text item"
>
{{'列表内容 ' + o }}
</div>
</el-card>
</el-col>
</el-row>
```
html
<el-card>
<div
v-for=
"o in 4"
class=
"text item"
>
{{'列表内容 ' + o }}
</div>
</el-card>
```
## 带图片
可配置定义更丰富的内容展示
<el-row>
<el-col
:span=
"8"
v-for=
"(o, index) in 2"
:offset=
"index >
0 ? 2 : 0">
<el-card :body-style="
{
padding:
'
0px
'
}"
>
<img
src=
"~examples/assets/images/hamburger.png"
class=
"image"
>
<div
style=
"padding: 14px;"
>
<span>
好吃的汉堡
</span>
<div
class=
"bottom clearfix"
>
<time
class=
"time"
>
{{ currentDate }}
</time>
<el-button
type=
"text"
class=
"button"
>
操作按钮
</el-button>
</div>
</div>
</el-card>
</el-col>
</el-row>
```
html
<el-card
:body-style=
"{ padding: '0px' }"
>
<img
src=
"~examples/assets/images/hamburger.png"
class=
"image"
>
<div
style=
"padding: 14px;"
>
<span>
好吃的汉堡
</span>
<div
class=
"bottom clearfix"
>
<time
class=
"time"
>
{{ currentDate }}
</time>
<el-button
type=
"text"
class=
"button"
>
操作按钮
</el-button>
</div>
</div>
</el-card>
```
## API
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------- |---------- |------------- |-------- |
| header | 设置 header,也可以通过
`slot#header`
传入 DOM | string| | |
| body-style | 设置 body 的样式| object| | { padding: '20px' } |
examples/nav.config.json
View file @
e99a7b3d
...
@@ -92,6 +92,12 @@
...
@@ -92,6 +92,12 @@
"name"
:
"加载 (loading)"
,
"name"
:
"加载 (loading)"
,
"title"
:
"loading 加载"
,
"title"
:
"loading 加载"
,
"description"
:
"加载数据时显示"
"description"
:
"加载数据时显示"
},
{
"path"
:
"/card"
,
"name"
:
"卡片 (card)"
,
"title"
:
"card 卡片"
,
"description"
:
"将信息聚合在卡片容器中展示"
}
}
]
]
},
},
...
...
packages/card/cooking.conf.js
0 → 100644
View file @
e99a7b3d
var
cooking
=
require
(
'
cooking
'
);
var
path
=
require
(
'
path
'
);
cooking
.
set
({
entry
:
{
index
:
path
.
join
(
__dirname
,
'
index.js
'
)
},
dist
:
path
.
join
(
__dirname
,
'
lib
'
),
template
:
false
,
format
:
'
umd
'
,
moduleName
:
'
ElCard
'
,
extractCSS
:
'
style.css
'
,
extends
:
[
'
vue
'
,
'
saladcss
'
]
});
cooking
.
add
(
'
resolve.alias
'
,
{
'
main
'
:
path
.
join
(
__dirname
,
'
../../src
'
),
'
packages
'
:
path
.
join
(
__dirname
,
'
../../packages
'
)
});
cooking
.
add
(
'
externals
'
,
{
vue
:
{
root
:
'
Vue
'
,
commonjs
:
'
vue
'
,
commonjs2
:
'
vue
'
,
amd
:
'
vue
'
}
});
module
.
exports
=
cooking
.
resolve
();
packages/card/index.js
0 → 100644
View file @
e99a7b3d
const
Card
=
require
(
'
./src/main
'
);
Card
.
install
=
function
(
Vue
)
{
Vue
.
component
(
Card
.
name
,
Card
);
};
module
.
exports
=
Card
;
packages/card/package.json
0 → 100644
View file @
e99a7b3d
{
"name"
:
"el-card"
,
"version"
:
"0.0.0"
,
"description"
:
"A card component for Vue.js."
,
"keywords"
:
[
"element"
,
"vue"
,
"component"
],
"main"
:
"./lib/index.js"
,
"repository"
:
"https://github.com/element-component/element/tree/master/packages/card"
,
"author"
:
"elemefe"
,
"license"
:
"MIT"
,
"dependencies"
:
{}
}
packages/card/src/main.vue
0 → 100644
View file @
e99a7b3d
<
template
>
<div
class=
"el-card"
>
<div
class=
"el-card__header"
v-if=
"$slots.header"
>
<slot
name=
"header"
>
{{
header
}}
</slot>
</div>
<div
class=
"el-card__body"
:style=
"bodyStyle"
>
<slot></slot>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'
el-card
'
,
props
:
[
'
header
'
,
'
bodyStyle
'
]
};
</
script
>
packages/date-picker/src/util/index.js
View file @
e99a7b3d
import
dateUtil
from
'
./fecha
'
;
import
dateUtil
from
'
main/utils/date
'
;
const
newArray
=
function
(
start
,
end
)
{
const
newArray
=
function
(
start
,
end
)
{
let
result
=
[];
let
result
=
[];
...
...
packages/theme-default/src/card.css
0 → 100644
View file @
e99a7b3d
@charset
"UTF-8"
;
@import
"./common/var.css"
;
@component-namespace
el
{
@b
card
{
border
:
1px
solid
var
(
--card-border-color
);
border-radius
:
var
(
--card-border-radius
);
background-color
:
#fff
;
overflow
:
hidden
;
box-shadow
:
0px
2px
4px
0px
rgba
(
0
,
0
,
0
,
.12
),
0px
0px
6px
0px
rgba
(
0
,
0
,
0
,
.04
);
@e
header
{
padding
:
calc
(
var
(
--card-padding
)
-
2
)
var
(
--card-padding
);
border-bottom
:
1px
solid
var
(
--card-border-color
);
box-sizing
:
border-box
;
}
@e
body
{
padding
:
var
(
--card-padding
);
}
}
}
packages/theme-default/src/common/var.css
View file @
e99a7b3d
...
@@ -361,4 +361,10 @@
...
@@ -361,4 +361,10 @@
--badge-font-size
:
12px
;
--badge-font-size
:
12px
;
--badge-padding
:
6px
;
--badge-padding
:
6px
;
--badge-size
:
18px
;
--badge-size
:
18px
;
/*Card
--------------------------*/
--card-border-color
:
var
(
--disabled-border-base
);
--card-border-radius
:
4px
;
--card-padding
:
20px
;
}
}
packages/theme-default/src/index.css
View file @
e99a7b3d
...
@@ -33,3 +33,4 @@
...
@@ -33,3 +33,4 @@
@import
"./col.css"
;
@import
"./col.css"
;
@import
"./spinner.css"
;
@import
"./spinner.css"
;
@import
"./badge.css"
;
@import
"./badge.css"
;
@import
"./card.css"
;
packages/date-picker/src/util/fecha
.js
→
src/utils/date
.js
View file @
e99a7b3d
File moved
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