ECharts Tooltip 不显示问题 - Vue Ref vs 普通变量 #13901
Unanswered
trry-hub
asked this question in
Help/Questions
Replies: 1 comment
-
试试shallowRef呢。哪怕没有bug也不建议在这种情况下使用ref,因为ref会深层的对每一个属性做响应,对于这种复杂对象可能会导致严重性能问题 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Vue version
3.5.21
Link to minimal reproduction
https://github.com/trry-hub/issues/tree/echarts
Steps to reproduce
问题描述
在 Vue 3 + ECharts 项目中,当使用 Vue 的
ref()
来存储 ECharts 实例时,图表的 tooltip 无法正常显示。但使用普通变量存储 ECharts 实例时,tooltip 可以正常工作。What is expected?
两种方法都应该能够正常显示 tooltip,当鼠标悬停在图表上时应该显示相应的数据信息。
What is actually happening?
环境信息
复现步骤
方法一:使用普通变量(tooltip 正常工作)
方法二:使用 Vue ref(tooltip 不工作)
System Info
Any additional comments?
实际行为
可能的原因分析
临时解决方案
目前使用普通变量而非 Vue ref 来存储 ECharts 实例可以避免此问题。
Beta Was this translation helpful? Give feedback.
All reactions