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
23e86bcf
Commit
23e86bcf
authored
Nov 17, 2017
by
Leopoldthecoder
Committed by
杨奕
Nov 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Table: fix high CPU consumption
parent
1af69895
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
10 deletions
+3
-10
examples/docs/en-US/table.md
examples/docs/en-US/table.md
+1
-0
examples/docs/zh-CN/table.md
examples/docs/zh-CN/table.md
+1
-0
packages/table/src/table.vue
packages/table/src/table.vue
+1
-10
No files found.
examples/docs/en-US/table.md
View file @
23e86bcf
...
...
@@ -1990,6 +1990,7 @@ You can customize row index in `type=index` columns.
| setCurrentRow | used in single selection Table, set a certain row selected. If called without any parameter, it will clear selection. | row |
| clearSort | clear sorting, restore data to the original order | — |
| clearFilter | clear filter | — |
| doLayout | Refresh the layout of Table. When the visibility of Table changes, you may need to call this method to get a correct layout | — |
### Table Slot
| Name | Description |
...
...
examples/docs/zh-CN/table.md
View file @
23e86bcf
...
...
@@ -2053,6 +2053,7 @@
| setCurrentRow | 用于单选表格,设定某一行为选中行,如果调用时不加参数,则会取消目前高亮行的选中状态。 | row |
| clearSort | 用于清空排序条件,数据会恢复成未排序的状态 | — |
| clearFilter | 用于清空过滤条件,数据会恢复成未过滤的状态 | — |
| doLayout | 对 Table 进行重新布局。当 Table 或其祖先元素由隐藏切换为显示时,可能需要调用此方法 | — |
### Table Slot
| name | 说明 |
...
...
packages/table/src/table.vue
View file @
23e86bcf
...
...
@@ -345,7 +345,6 @@
this
.
updateScrollY
();
this
.
layout
.
update
();
this
.
$nextTick
(()
=>
{
if
(
this
.
destroyed
)
return
;
if
(
this
.
height
)
{
this
.
layout
.
setHeight
(
this
.
height
);
}
else
if
(
this
.
maxHeight
)
{
...
...
@@ -353,12 +352,6 @@
}
else
if
(
this
.
shouldUpdateHeight
)
{
this
.
layout
.
updateHeight
();
}
if
(
this
.
$el
)
{
this
.
isHidden
=
this
.
$el
.
clientWidth
===
0
;
if
(
this
.
isHidden
&&
this
.
layout
.
bodyWidth
)
{
setTimeout
(()
=>
this
.
debouncedLayout
());
}
}
});
}
},
...
...
@@ -497,7 +490,6 @@
},
destroyed
()
{
this
.
destroyed
=
true
;
if
(
this
.
windowResizeListener
)
removeResizeListener
(
this
.
$el
,
this
.
windowResizeListener
);
},
...
...
@@ -538,8 +530,7 @@
resizeProxyVisible
:
false
,
// 是否拥有多级表头
isGroup
:
false
,
scrollPosition
:
'
left
'
,
destroyed
:
false
scrollPosition
:
'
left
'
};
}
};
...
...
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