Skip to content

Commit

Permalink
Table: improveper formance for init tooltip, fixed ElemeFE#3836
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li authored and Leopoldthecoder committed Apr 6, 2017
1 parent 1184389 commit cb0a600
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/table/src/table-body.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getCell, getColumnByCell, getRowIdentity } from './util';
import { hasClass } from 'element-ui/src/utils/dom';
import ElCheckbox from 'element-ui/packages/checkbox';
import ElTooltip from 'element-ui/packages/tooltip';
import debounce from 'throttle-debounce/debounce';
Expand Down Expand Up @@ -208,7 +209,7 @@ export default {
// 判断是否text-overflow, 如果是就显示tooltip
const cellChild = event.target.querySelector('.cell');

if (cellChild.scrollWidth > cellChild.offsetWidth) {
if (hasClass(cellChild, 'el-tooltip') && cellChild.scrollWidth > cellChild.offsetWidth) {
const tooltip = this.$refs.tooltip;

this.tooltipContent = cell.innerText;
Expand Down

0 comments on commit cb0a600

Please sign in to comment.