S2
S2 copied to clipboard
🤔 angular 引用 @antv/s2 进行演示demo 使用ts严格模式 报错
🏷 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
https://github.com/antvis/S2/issues/1724
暂时还不支持严格模式, 在处理中, 暂时请 exclude @antv/s2, 抱歉
你好 @929496959,感谢你的建议, 我们会及时评估和排期, 谢谢!
Hello, @929496959, thanks for your advice. We will evaluate and schedule in time. Thank you!
#1859 已支持, 后续会发布