|
@@ -66,7 +66,7 @@ const getRenderText = (
|
|
ellipsisContainer.style.left = '0';
|
|
ellipsisContainer.style.left = '0';
|
|
// 当 window.getComputedStyle 得到的 width 值为 auto 时,通过 getBoundingClientRect 得到准确宽度
|
|
// 当 window.getComputedStyle 得到的 width 值为 auto 时,通过 getBoundingClientRect 得到准确宽度
|
|
// When the width value obtained by window.getComputedStyle is auto, get the exact width through getBoundingClientRect
|
|
// When the width value obtained by window.getComputedStyle is auto, get the exact width through getBoundingClientRect
|
|
- if (originStyle.getPropertyValue('width') === 'auto') {
|
|
|
|
|
|
+ if (originStyle.getPropertyValue('width') === 'auto' && originEle.offsetWidth) {
|
|
ellipsisContainer.style.width = `${originEle.offsetWidth}px`;
|
|
ellipsisContainer.style.width = `${originEle.offsetWidth}px`;
|
|
}
|
|
}
|
|
ellipsisContainer.style.height = 'auto';
|
|
ellipsisContainer.style.height = 'auto';
|