antvis / S2

⚡️ A practical visualization library for tabular analysis.

Home Page:https://s2.antv.antgroup.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐛 next版本明细表导出列头meta配置失效

wozien opened this issue · comments

🏷 Version

Package Version
@antv/s2 2.0.0-next.17

Sheet Type

  • TableSheet

🖋 Description

next版本明细表导出列头meta配置失效, 导出还是显示原来的字段field
image
调用asyncGetAllPlainData获取导出数据,打印如下:
name,area,price
iphone15,华东,6999
iphone15 pro,华东,8999

⌨️ Code Snapshots

https://stackblitz.com/edit/vitejs-vite-m4qgeu?file=src%2FApp.tsx

🔗 Reproduce Link

https://stackblitz.com/edit/vitejs-vite-m4qgeu?file=src%2FApp.tsx

🤔 Steps to Reproduce

明细表调用asyncGetAllPlainData

😊 Expected Behavior

列头正常显示中文格式化

😅 Current Behavior

列头没有正常显示中文格式化

💻 System information

Environment Info
System macos 13
Browser 123.0.6312.87(正式版本) (arm64)

你这里关闭了格式化的配置, 所以未按 meta 格式化是符合预期的.

image

https://s2.antv.antgroup.com/manual/advanced/interaction/copy#formatoptions

这样修改下即可

image

const data = await asyncGetAllPlainData({
  sheetInstance: s2Instance.current,
  split: ',',
- formatOptions: false,
+ formatOptions: true,
// 或者
+ formatOptions: {
+   formatHeader: true;
+   formatData: true;
+ }
});

感谢回复,但是我发现交叉表formatOptions:false导出是正常的