Browse Source

Update table-body.js

添加一个this.$refs.tooltip是否存在的判断
lyh2668 7 năm trước cách đây
mục cha
commit
4f00d7dea8
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      packages/table/src/table-body.js

+ 1 - 1
packages/table/src/table-body.js

@@ -340,7 +340,7 @@ export default {
       // 判断是否text-overflow, 如果是就显示tooltip
       const cellChild = event.target.querySelector('.cell');
 
-      if (hasClass(cellChild, 'el-tooltip') && cellChild.scrollWidth > cellChild.offsetWidth) {
+      if (hasClass(cellChild, 'el-tooltip') && cellChild.scrollWidth > cellChild.offsetWidth && this.$refs.tooltip) {
         const tooltip = this.$refs.tooltip;
 
         this.tooltipContent = cell.innerText;