ecomfe / vue-echarts

Vue.js component for Apache ECharts™.
https://vue-echarts.dev
MIT License
9.43k stars 1.48k forks source link

修复loading参数改变后,loading效果没有更新问题 #792

Closed lizhen789 closed 2 weeks ago

lizhen789 commented 3 weeks ago

修复加载动画参数loadOptions改变后,再次显示loading时,loadOptions参数没有及时更新问题。

具体效果可以查看PolarChart.vue这个demo。

vercel[bot] commented 3 weeks ago

@lizhen789 is attempting to deploy a commit to the EFE Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vue-echarts ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 5:56am
Justineo commented 2 weeks ago

我给线上的 demo 加了一个 loading 切换,没有复现这个问题,切换 theme 的时候会更新 loading-options,然后你再切换一下 loading 试试。 https://vue-echarts.dev/#polar

lizhen789 commented 2 weeks ago

通过provide方式不行,因为你对代理对象进行了unref,所以失去了属性的响应式,导致参数改变后realLoadingOptions的值没有更新,你可以试试,我刚试了你的方式,通过props方式是可以。 image

Justineo commented 2 weeks ago

我测试了用 provide 也没有问题,你可以给一个最小化的重现么?可以基于模板修改。

lizhen789 commented 2 weeks ago

我弄了一个重现的模板

lizhen789 commented 2 weeks ago

我找到原因了,自己搞错了,用了shallowRef,而不是直接用的ref。你看看合不合吧,主要原因是shallowRef的问题。

Justineo commented 2 weeks ago

好的,那当前行为是符合预期的,我先关闭了。