[Bug] Taro 4.x中使用时,更新spec不会刷新图表
Version
2.0.6
Link to Minimal Reproduction
https://github.com/TTwilight/vcharts-demo
Steps to Reproduce
- 设置了一个自动刷新spec的值,触发了更新事件,但图表没有刷新
Current Behavior
<VChart type="weapp" spec={spec} options={{ // renderCanvas:'canvasId' // options3d: { // enable: false, // enableView3dTransform: false, // }, // mode: "miniApp", }} canvasId="canvasId" style={{ height: "45vh", width: "70%", // zIndex: 1, }} onChartInit={(chart) => { console.log("图表初始化完成:", chart); chartIns.current = chart; }} onChartReady={(chart) => { console.log("图表渲染完成:", chart); }} onChartUpdate={(chart) => { console.log("图表更新完成:", chart); }} />
Expected Behavior
自动刷新spec的值,图表同步更新
Environment
- OS: Macos 26.0.1
- Browser: chrome 141.0.7390.109(正式版本) (arm64)
- Framework: Taro 4.1.5
- 开发工具:微信开发者工具
Any additional comments?
No response
taro版本 "dependencies": { "@babel/runtime": "^7.24.4", "@tarojs/components": "4.1.5", "@tarojs/helper": "4.1.5", "@tarojs/plugin-platform-weapp": "4.1.5", "@tarojs/plugin-platform-alipay": "4.1.5", "@tarojs/plugin-platform-tt": "4.1.5", "@tarojs/plugin-platform-swan": "4.1.5", "@tarojs/plugin-platform-jd": "4.1.5", "@tarojs/plugin-platform-qq": "4.1.5", "@tarojs/plugin-platform-h5": "4.1.5", "@tarojs/plugin-platform-harmony-hybrid": "4.1.5", "@tarojs/runtime": "4.1.5", "@tarojs/shared": "4.1.5", "@tarojs/taro": "4.1.5", "@tarojs/plugin-framework-react": "4.1.5", "@tarojs/react": "4.1.5", "react-dom": "^18.0.0", "react": "^18.0.0", "@visactor/taro-vchart": "^2.0.3", "@visactor/vchart": "^2.0.3" },
收到,我们看一下问题