From 4f00d7dea84c5b38c686c2f700520fc6ec59dca0 Mon Sep 17 00:00:00 2001 From: lyh2668 Date: Tue, 14 Nov 2017 22:26:39 +0800 Subject: [PATCH] Update table-body.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加一个this.$refs.tooltip是否存在的判断 --- packages/table/src/table-body.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/table/src/table-body.js b/packages/table/src/table-body.js index 15dc5ba2a..89475f6df 100644 --- a/packages/table/src/table-body.js +++ b/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;