arco-design-vue icon indicating copy to clipboard operation
arco-design-vue copied to clipboard

auto-tooltip动态内容时不生效

Open tipsxBase opened this issue 6 months ago • 0 comments

Image 默认 span 默认是行内元素,ResizeObserver 对其不生效,这就导致当 span 中的内容动态变化时,tooltip 不会正确产生

    const renderContent = () => {
      return (
        <span ref={containerRef} class={prefix} {...attrs}>
          <ResizeObserver onResize={onResize}>
            <span  class={`${prefix}-content inline-block max-w-full truncate`}>
              <span ref={contentRef}>{slots.default?.()}</span>
            </span>
          </ResizeObserver>
        </span>
      );
    };

如上修改即可修复问题(inline-block max-w-full truncate 是 tailwindcss)

tipsxBase avatar May 27 '25 08:05 tipsxBase