wujie icon indicating copy to clipboard operation
wujie copied to clipboard

element tooltip 位置偏移

Open SericXu opened this issue 1 year ago • 1 comments

如图,初步检查发现这个tooltip采用的是固定定位。何解🤣 image

image

SericXu avatar Oct 12 '22 02:10 SericXu

https://github.com/Tencent/wujie/pull/214#issuecomment-1277226699 新版本已经解决了。 已经发布 appendOrInsertElementHook 采用这个 plugin

quqingfei avatar Oct 13 '22 08:10 quqingfei

解决这个问题的关键就是将 tooltip 的定位采用 absolute 定位 而非 fixed 定位

popperjs 有 strategy 字段可以配置的,但是大部分框架没有开放或者将这个字段写死成 fixed

所以 ,解决方案是可以通过代码替换的方式,改变 tooltiop 的定位方式

element-ui 的 tooltip 有 popper-options 这个配置可以设置:

popper-options : {
  strategy: 'absolute',
}

element-plus 可以看看这个解决方案

yiludege avatar Oct 19 '22 03:10 yiludege