arco-design-vue
arco-design-vue copied to clipboard
auto-tooltip动态内容时不生效
默认 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)