ecomfe / vue-echarts

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

VChat option type are broken #751

Closed kaine0923 closed 6 months ago

kaine0923 commented 6 months ago

请确认

您是如何将 Vue-ECharts 引入项目的?

通过 ES 模块 import

版本信息

+-- vue-echarts@6.6.2 
| +-- echarts@5.4.3 
| +-- vue-demi@0.13.11
| `-- vue@3.3.10

问题详情

image

https://github.com/ecomfe/vue-echarts/blob/e224c49951d148d3b0dc300e2b5640a7ea7d1540/src/types.ts#L26

https://github.com/apache/echarts/blob/master/src/export/core.ts#L96-L113

[key in GetMainType<OptionUnion>]?: Arrayable<ExtractComponentOption<OptionUnion, key>>

The purpose of this code is to retrieve the option type for a specific component in EChartsOption. However, due to the type inference, the code produces the following inference result

[x: string]: unknown
[x: number]: unknown

问题复现

https://github.com/kaine0923/vue-echarts-type-issue

liyuan1125 commented 6 months ago

+1

radusuciu commented 6 months ago

Can confirm this issue happens with versions > 6.6.1. Option typing and inference worked fine for me before but is now broken.

DMOAbove commented 6 months ago

Same here, after 6.6.1 as previously said.

image

demiro commented 6 months ago

I have the same issue... and can confirm that downgrading it to 6.6.1 works

Justineo commented 6 months ago

Seems to be introduced by https://github.com/ecomfe/vue-echarts/commit/e224c49951d148d3b0dc300e2b5640a7ea7d1540.

I've reverted the changes and it should be now fixed in v6.6.5.