S2 icon indicating copy to clipboard operation
S2 copied to clipboard

🤔 angular 引用 @antv/s2 进行演示demo 使用ts严格模式 报错

Open 929496959 opened this issue 3 years ago • 3 comments

🏷 Version

Package Version
@antv/s2 1.29
@antv/s2-react
@antv/s2-vue

Sheet Type

  • [ ] PivotSheet
  • [ x ] TableSheet
  • [ ] GridAnalysisSheet
  • [ ] StrategySheet

🖋 Description

err info

` Error: node_modules/@antv/s2/esm/index.d.ts:1188:5 - error TS2416: Property 'getIconStyle' in type 'DataCell' is not assignable to the same property in base type 'BaseCell<ViewMeta>'. Type '() => IconCfg | undefined' is not assignable to type '() => IconTheme'. Type 'IconCfg | undefined' is not assignable to type 'IconTheme'. Type 'undefined' is not assignable to type 'IconTheme'.

1188 getIconStyle(): IconCfg | undefined; ~~~~~~~~~~~~

Error: node_modules/@antv/s2/esm/index.d.ts:2885:9 - error TS2411: Property 'red' of type 'string | undefined' is not assignable to 'string' index type 'string'.

2885 red?: string; ~~~

Error: node_modules/@antv/s2/esm/index.d.ts:2886:9 - error TS2411: Property 'green' of type 'string | undefined' is not assignable to 'string' index type 'string'.

2886 green?: string; ~~~~~

Error: node_modules/@antv/s2/esm/index.d.ts:2887:9 - error TS2411: Property 'yellow' of type 'string | undefined' is not assignable to 'string' index type 'string'.

2887 yellow?: string; ~~~~~~

`

demo info

const s2Data:S2DataConfig = { fields: { columns: ['province', 'city', 'type', 'price'] }, data: [ { "province": "浙江", "city": "杭州", "type": "笔", "price": 1 }, { "province": "浙江", "city": "杭州", "type": "纸张", "price": 2 }, { "province": "浙江", "city": "舟山", "type": "笔", "price": 17 }, { "province": "浙江", "city": "舟山", "type": "纸张", "price": 6 }, { "province": "吉林", "city": "长春", "type": "笔", "price": 8 }, { "province": "吉林", "city": "白山", "type": "笔", "price": 12 }, { "province": "吉林", "city": "长春", "type": "纸张", "price": 3 }, { "province": "吉林", "city": "白山", "type": "纸张", "price": 25 }, { "province": "浙江", "city": "杭州", "type": "笔", "price": 20 }, { "province": "浙江", "city": "杭州", "type": "纸张", "price": 10 }, { "province": "浙江", "city": "舟山", "type": "笔", "price": 15 }, { "province": "浙江", "city": "舟山", "type": "纸张", "price": 2 }, { "province": "吉林", "city": "长春", "type": "笔", "price": 15 }, { "province": "吉林", "city": "白山", "type": "笔", "price": 30 }, { "province": "吉林", "city": "长春", "type": "纸张", "price": 40 }, { "province": "吉林", "city": "白山", "type": "纸张", "price": 50 } ], }; const s2Options:S2Options = { width: 1600, height: 580 } const themeCfg:ThemeCfg={}; // TableSheet PivotSheet const s2 = new TableSheet(this.CanvasTab.nativeElement,s2Data,s2Options); // s2.setThemeCfg(themeCfg); s2.render();

🔗 Reproduce Link

😊 Expected Behavior

😅 Current Behavior

929496959 avatar Sep 06 '22 13:09 929496959

https://github.com/antvis/S2/issues/1724

lijinke666 avatar Sep 07 '22 02:09 lijinke666

暂时还不支持严格模式, 在处理中, 暂时请 exclude @antv/s2, 抱歉

lijinke666 avatar Sep 07 '22 02:09 lijinke666

你好 @929496959,感谢你的建议, 我们会及时评估和排期, 谢谢!

Hello, @929496959, thanks for your advice. We will evaluate and schedule in time. Thank you!

github-actions[bot] avatar Sep 07 '22 02:09 github-actions[bot]

#1859 已支持, 后续会发布

lijinke666 avatar Nov 14 '22 02:11 lijinke666