element表格显示两行文字,超过用省略号代替,鼠标移入上方显示完整文字

element表格显示两行文字,超过用省略号代替,鼠标移入上方显示完整文字_第1张图片
      
        
      
   showTips(obj, row) {
      let TemporaryTag = document.createElement('span');
      TemporaryTag.innerText = row.newtitle;
      TemporaryTag.className = 'getTextWidth';
      document.querySelector('body').appendChild(TemporaryTag);
      let currentWidth = document.querySelector('.getTextWidth').offsetWidth;
      document.querySelector('.getTextWidth').remove();
      const cellWidth = obj.target.offsetWidth
      currentWidth <= (2 * cellWidth) ? row.showTooltip = false : row.showTooltip = true
    },
.myNote{
  display:-webkit-box;
  text-overflow:ellipsis;
  overflow:hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient:vertical;
}

你可能感兴趣的:(vue,小程序)