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
56ed21df
Commit
56ed21df
authored
Sep 21, 2016
by
cinwell.li
Committed by
FuryBean
Sep 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TableColumn: add align attribute, #78 (#94)
parent
76683d1b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
2 deletions
+17
-2
examples/docs/table.md
examples/docs/table.md
+1
-0
packages/table/src/table-body.js
packages/table/src/table-body.js
+1
-1
packages/table/src/table-column.js
packages/table/src/table-column.js
+2
-0
packages/table/src/table-header.js
packages/table/src/table-header.js
+1
-1
packages/theme-default/src/table.css
packages/theme-default/src/table.css
+12
-0
No files found.
examples/docs/table.md
View file @
56ed21df
...
@@ -865,3 +865,4 @@
...
@@ -865,3 +865,4 @@
| formatter | 用来格式化内容,在 formatter 执行的时候,会传入 row 和 column | function | — | — |
| formatter | 用来格式化内容,在 formatter 执行的时候,会传入 row 和 column | function | — | — |
| show-tooltip-when-overflow | 当过长被隐藏时显示 tooltip | Boolean | — | false |
| show-tooltip-when-overflow | 当过长被隐藏时显示 tooltip | Boolean | — | false |
| inline-template | 指定该属性后可以自定义 column 模板,参考多选的时间列,通过 row 获取行信息,JSX 里通过 _self 获取当前上下文。此时不需要配置 property 属性 | — | — |
| inline-template | 指定该属性后可以自定义 column 模板,参考多选的时间列,通过 row 获取行信息,JSX 里通过 _self 获取当前上下文。此时不需要配置 property 属性 | — | — |
| align | 对齐方式 | String | left, center, right | left |
packages/table/src/table-body.js
View file @
56ed21df
...
@@ -52,7 +52,7 @@ export default {
...
@@ -52,7 +52,7 @@ export default {
this
.
_l
(
this
.
columns
,
(
column
)
=>
this
.
_l
(
this
.
columns
,
(
column
)
=>
<
td
<
td
style
=
{
this
.
getColumnWhiteSpaceStyle
(
column
)
}
style
=
{
this
.
getColumnWhiteSpaceStyle
(
column
)
}
class
=
{
column
.
id
}
class
=
{
[
column
.
id
,
column
.
align
]
}
on
-
mouseenter
=
{
(
$event
)
=>
this
.
handleCellMouseEnter
(
$event
,
row
)
}
on
-
mouseenter
=
{
(
$event
)
=>
this
.
handleCellMouseEnter
(
$event
,
row
)
}
on
-
mouseleave
=
{
this
.
handleCellMouseLeave
}
>
on
-
mouseleave
=
{
this
.
handleCellMouseLeave
}
>
{
{
...
...
packages/table/src/table-column.js
View file @
56ed21df
...
@@ -83,6 +83,7 @@ export default {
...
@@ -83,6 +83,7 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
default
:
true
default
:
true
},
},
align
:
String
,
showTooltipWhenOverflow
:
{
showTooltipWhenOverflow
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
...
@@ -160,6 +161,7 @@ export default {
...
@@ -160,6 +161,7 @@ export default {
minWidth
,
minWidth
,
width
,
width
,
isColumnGroup
,
isColumnGroup
,
align
:
this
.
align
?
'
is-
'
+
this
.
align
:
null
,
realWidth
:
width
||
minWidth
,
realWidth
:
width
||
minWidth
,
sortable
:
this
.
sortable
,
sortable
:
this
.
sortable
,
resizable
:
this
.
resizable
,
resizable
:
this
.
resizable
,
...
...
packages/table/src/table-header.js
View file @
56ed21df
...
@@ -26,7 +26,7 @@ export default {
...
@@ -26,7 +26,7 @@ export default {
on
-
mouseout
=
{
this
.
handleMouseOut
}
on
-
mouseout
=
{
this
.
handleMouseOut
}
on
-
mousedown
=
{
(
$event
)
=>
this
.
handleMouseDown
(
$event
,
column
)
}
on
-
mousedown
=
{
(
$event
)
=>
this
.
handleMouseDown
(
$event
,
column
)
}
on
-
click
=
{
(
$event
)
=>
this
.
handleHeaderClick
(
$event
,
column
)
}
on
-
click
=
{
(
$event
)
=>
this
.
handleHeaderClick
(
$event
,
column
)
}
class
=
{
[
column
.
id
,
column
.
direction
]
}
>
class
=
{
[
column
.
id
,
column
.
direction
,
column
.
align
]
}
>
{
{
[
[
column
.
headerTemplate
column
.
headerTemplate
...
...
packages/theme-default/src/table.css
View file @
56ed21df
...
@@ -62,6 +62,18 @@
...
@@ -62,6 +62,18 @@
vertical-align
:
middle
;
vertical-align
:
middle
;
position
:
relative
;
position
:
relative
;
border-bottom
:
1px
solid
var
(
--table-border-color
);
border-bottom
:
1px
solid
var
(
--table-border-color
);
@when
center
{
text-align
:
center
;
}
@when
left
{
text-align
:
left
;
}
@when
right
{
text-align
:
right
;
}
}
}
@modifier
border
{
@modifier
border
{
...
...
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