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
073b7915
Commit
073b7915
authored
Aug 26, 2016
by
baiyaaaaa
Committed by
GitHub
Aug 26, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #101 from QingWei-Li/feat/next-buglist0825
Fix buglist 0825
parents
6565811a
561f7014
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
14 deletions
+21
-14
examples/docs/popover.md
examples/docs/popover.md
+2
-1
examples/docs/table.md
examples/docs/table.md
+2
-1
packages/table/src/table-body.js
packages/table/src/table-body.js
+2
-3
packages/table/src/table.vue
packages/table/src/table.vue
+15
-9
No files found.
examples/docs/popover.md
View file @
073b7915
...
...
@@ -76,7 +76,8 @@
address: '上海市普陀区金沙江路 1518 弄'
}],
singleSelection: {},
multipleSelection:
[]
multipleSelection:
[]
,
model: ''
};
},
...
...
examples/docs/table.md
View file @
073b7915
...
...
@@ -676,4 +676,5 @@ Table 组件中,只要在列中设置`sortable`属性即可实现以该列为
| type | 对应列的类型。如果设置了
`selection`
则显示多选按钮,如果设置了
`index`
则显示该行的索引(从 1 开始计算) | string | 'selection', 'index' | 0 |
| formatter | 用来格式化内容,在 formatter 执行的时候,会传入 row 和 column | function | | |
| show-tooltip-when-overflow | 当过长被隐藏时显示 tooltip | Boolean | | false |
| inline-template | 指定该属性后可以自定义 column 模板,参考多选的时间列,通过 row 获取行信息。此时不需要配置 property 属性 | | |
| inline-template | 指定该属性后可以自定义 column 模板,参考多选的时间列,通过 row 获取行信息,通过 _self 获取当前上下文。此时不需要配置 property 属性 | | |
packages/table/src/table-body.js
View file @
073b7915
...
...
@@ -44,7 +44,7 @@ export default {
on
-
click
=
{
(
$event
)
=>
this
.
handleClick
(
$event
,
row
)
}
on
-
mouseenter
=
{
_
=>
this
.
handleMouseEnter
(
$index
)
}
class
=
{{
'
current-row
'
:
row
===
this
.
$parent
.
$parent
.
selected
,
'
current-row
'
:
row
===
this
.
$parent
.
selected
,
'
hover
'
:
this
.
$parent
.
$parent
.
hoverRowIndex
===
$index
,
'
positive-row
'
:
row
.
$positive
,
'
info-row
'
:
row
.
$info
,
...
...
@@ -59,7 +59,7 @@ export default {
on
-
mouseleave
=
{
this
.
handleCellMouseLeave
}
>
{
column
.
template
?
column
.
template
.
call
(
this
.
_renderProxy
,
h
,
{
row
,
column
,
$index
})
?
column
.
template
.
call
(
this
.
_renderProxy
,
h
,
{
row
,
column
,
$index
,
_self
:
this
.
$parent
.
$parent
})
:
<
div
class
=
"
cell
"
>
{
this
.
$getPropertyText
(
row
,
column
.
property
,
column
.
id
)
}
<
/div
>
}
<
/td
>
...
...
@@ -131,7 +131,6 @@ export default {
if
(
grid
.
selectionMode
===
'
single
'
)
{
grid
.
selected
=
row
;
grid
.
$emit
(
'
selectionchange
'
,
row
);
}
grid
.
$emit
(
'
rowclick
'
,
row
,
event
);
...
...
packages/table/src/table.vue
View file @
073b7915
...
...
@@ -251,8 +251,9 @@
gridWrapper
.
style
.
height
=
bodyHeight
+
'
px
'
;
this
.
$el
.
style
.
height
=
height
+
'
px
'
;
this
.
$refs
.
fixed
.
style
.
height
=
height
+
'
px
'
;
if
(
this
.
$refs
.
fixed
)
{
this
.
$refs
.
fixed
.
style
.
height
=
height
+
'
px
'
;
}
const
fixedBodyWrapper
=
this
.
$el
.
querySelector
(
'
.el-table__fixed-body-wrapper
'
);
if
(
fixedBodyWrapper
)
{
fixedBodyWrapper
.
style
.
height
=
(
this
.
showHScrollBar
?
gridWrapper
.
offsetHeight
-
this
.
currentGutterWidth
:
gridWrapper
.
offsetHeight
)
+
'
px
'
;
...
...
@@ -312,7 +313,6 @@
},
created
()
{
this
.
tableData
=
this
.
data
;
this
.
gridId
=
'
grid_
'
+
gridIdSeed
+
'
_
'
;
if
(
GUTTER_WIDTH
===
undefined
)
{
...
...
@@ -370,6 +370,14 @@
this
.
$calcHeight
(
value
);
},
data
(
val
)
{
if
(
val
&&
this
.
selectionMode
===
'
multiple
'
)
{
this
.
tableData
=
val
.
map
(
item
=>
objectAssign
({
'
$selected
'
:
false
},
item
));
}
else
{
this
.
tableData
=
val
;
}
},
tableData
(
newVal
)
{
this
.
doOnDataChange
(
newVal
);
this
.
updateScrollInfo
();
...
...
@@ -395,10 +403,6 @@
this
.
styleNode
=
styleNode
;
if
(
this
.
tableData
&&
this
.
selectionMode
===
'
multiple
'
)
{
this
.
tableData
=
this
.
tableData
.
map
(
item
=>
objectAssign
({
'
$selected
'
:
false
},
item
));
}
this
.
doRender
();
this
.
$ready
=
true
;
...
...
@@ -408,14 +412,16 @@
this
.
updateScrollInfo
();
if
(
this
.
fixedColumnCount
>
0
)
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
fixed
.
style
.
height
=
this
.
$el
.
clientHeight
+
'
px
'
;
const
style
=
this
.
$refs
.
fixed
.
style
;
if
(
!
style
)
return
;
style
.
height
=
this
.
$el
.
clientHeight
+
'
px
'
;
});
}
},
data
()
{
return
{
tableData
:
[]
,
tableData
:
this
.
data
,
showHScrollBar
:
false
,
showVScrollBar
:
false
,
hoverRowIndex
:
null
,
...
...
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