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
3551ff02
Commit
3551ff02
authored
May 11, 2017
by
qingwei.li
Committed by
杨奕
May 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Layout: custom element tag
parent
cc441fae
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
55 deletions
+60
-55
examples/docs/en-US/layout.md
examples/docs/en-US/layout.md
+3
-0
examples/docs/zh-CN/layout.md
examples/docs/zh-CN/layout.md
+2
-0
packages/col/src/col.js
packages/col/src/col.js
+8
-7
packages/row/src/row.js
packages/row/src/row.js
+47
-0
packages/row/src/row.vue
packages/row/src/row.vue
+0
-48
No files found.
examples/docs/en-US/layout.md
View file @
3551ff02
...
...
@@ -317,6 +317,7 @@ Taking example by Bootstrap's responsive design, four breakpoints are preset: xs
| type | layout mode, you can use flex, works in modern browsers | string | — | — |
| justify | horizontal alignment of flex layout | string | start/end/center/space-around/space-between | start |
| align | vertical alignment of flex layout | string | top/middle/bottom | top |
| tag | custom element tag | string |
*
| div |
### Col Attributes
| Attribute | Description | Type | Accepted Values | Default |
...
...
@@ -329,4 +330,6 @@ Taking example by Bootstrap's responsive design, four breakpoints are preset: xs
| sm |
`≥768px`
Responsive columns or column props object | number/object (e.g. {span: 4, offset: 4}) | — | — |
| md |
`≥992`
Responsive columns or column props object | number/object (e.g. {span: 4, offset: 4}) | — | — |
| lg |
`≥1200`
Responsive columns or column props object | number/object (e.g. {span: 4, offset: 4}) | — | — |
| tag | custom element tag | string |
*
| div |
examples/docs/zh-CN/layout.md
View file @
3551ff02
...
...
@@ -347,6 +347,7 @@
| type | 布局模式,可选 flex,现代浏览器下有效 | string | — | — |
| justify | flex 布局下的水平排列方式 | string | start/end/center/space-around/space-between | start |
| align | flex 布局下的垂直排列方式 | string | top/middle/bottom | top |
| tag | 自定义元素标签 | string |
*
| div |
### Col Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
...
...
@@ -359,3 +360,4 @@
| sm |
`≥768px`
响应式栅格数或者栅格属性对象 | number/object (例如: {span: 4, offset: 4}) | — | — |
| md |
`≥992`
响应式栅格数或者栅格属性对象 | number/object (例如: {span: 4, offset: 4}) | — | — |
| lg |
`≥1200`
响应式栅格数或者栅格属性对象 | number/object (例如: {span: 4, offset: 4}) | — | — |
| tag | 自定义元素标签 | string |
*
| div |
packages/col/src/col.js
View file @
3551ff02
...
...
@@ -6,6 +6,10 @@ export default {
type
:
Number
,
default
:
24
},
tag
:
{
type
:
String
,
default
:
'
div
'
},
offset
:
Number
,
pull
:
Number
,
push
:
Number
,
...
...
@@ -58,12 +62,9 @@ export default {
}
});
return
(
<
div
class
=
{[
'
el-col
'
,
classList
]}
style
=
{
style
}
>
{
this
.
$slots
.
default
}
<
/div
>
);
return
h
(
this
.
tag
,
{
class
:
[
'
el-col
'
,
classList
],
style
},
this
.
$slots
.
default
);
}
};
packages/row/src/row.js
0 → 100644
View file @
3551ff02
export
default
{
name
:
'
ElRow
'
,
componentName
:
'
ElRow
'
,
props
:
{
tag
:
{
type
:
String
,
default
:
'
div
'
},
gutter
:
Number
,
type
:
String
,
justify
:
{
type
:
String
,
default
:
'
start
'
},
align
:
{
type
:
String
,
default
:
'
top
'
}
},
computed
:
{
style
()
{
var
ret
=
{};
if
(
this
.
gutter
)
{
ret
.
marginLeft
=
`-
${
this
.
gutter
/
2
}
px`
;
ret
.
marginRight
=
ret
.
marginLeft
;
}
return
ret
;
}
},
render
(
h
)
{
return
h
(
this
.
tag
,
{
class
:
[
'
el-row
'
,
justify
!==
'
start
'
?
`is-justify-
${
this
.
justify
}
`
:
''
,
align
!==
'
top
'
?
`is-align-
${
this
.
align
}
`
:
''
,
{
'
el-row--flex
'
:
this
.
type
===
'
flex
'
}
],
style
:
this
.
style
},
this
.
$slots
.
default
);
}
};
packages/row/src/row.vue
deleted
100644 → 0
View file @
cc441fae
<
template
>
<div
class=
"el-row"
:style=
"style"
:class=
"[
justify !== 'start' ? 'is-justify-' + justify : '',
align !== 'top' ? 'is-align-' + align : '',
{
'el-row--flex': type === 'flex'
}
]"
>
<slot></slot>
</div>
</
template
>
<
script
>
export
default
{
name
:
'
ElRow
'
,
componentName
:
'
ElRow
'
,
props
:
{
gutter
:
Number
,
type
:
String
,
justify
:
{
type
:
String
,
default
:
'
start
'
},
align
:
{
type
:
String
,
default
:
'
top
'
}
},
computed
:
{
style
()
{
var
ret
=
{};
if
(
this
.
gutter
)
{
ret
.
marginLeft
=
`-
${
this
.
gutter
/
2
}
px`
;
ret
.
marginRight
=
ret
.
marginLeft
;
}
return
ret
;
}
}
};
</
script
>
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