Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛使用SpreadSheet:setOptions(options,true) 后 data部分tooltip展示空白。 #2489

Closed
1 of 5 tasks
db-shuai opened this issue Dec 21, 2023 · 1 comment
Closed
1 of 5 tasks

Comments

@db-shuai
Copy link

db-shuai commented Dec 21, 2023

🏷 Version

Package Version
@antv/s2 1.54.1
@antv/s2-react
@antv/s2-vue 1.6.0

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

在VUE中使用 SheetComponent 初始化后tooltip展示正常,
但调用 SpreadSheet:setOptions(options,true) 后,data 区域内的 tooltip 悬浮为空白块。

image

⌨️ Code Snapshots

🔗 Reproduce Link

https://codesandbox.io/p/sandbox/cranky-mopsa-5mflpr?file=%2Fsrc%2FApp.vue%3A9%2C19

🤔 Steps to Reproduce

示例中点击 设置 按钮,
然后鼠标点击数据区域单元格 可看到展示出的tooltip为空白块。

😊 Expected Behavior

调用 setOptions(options, true) 后,data区域的tooltip 正常展示而非空白块。

😅 Current Behavior

调用 setOptions(options, true)后,data区域的tooltip 展示为空白块。

💻 System information

Environment Info
System MacOS Monterey M1
Browser chrome: 120.0.6099.62
@lijinke666
Copy link
Member

Vue 的 tooltip 是通过 renderTooltip 自定义的 tooltip

image

你这里的 s2Table 拿到的是 @antv/s2 实例引用, 所以 s2Table.setOptions(options, true) 执行后 tooltip 配置被重置成了 @antv/s2 的默认配置, 所以变成了空白.

image

你可以直接改 const options = reactive(rawOptions) 的值, 或者这样

- s2Table.setOptions(options, true);
+ s2Table.setOptions(
+  {
+    ...options,
+    tooltip: s2Table.options.tooltip,
+  },
+  true
);

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants