Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
wozien opened this issue Apr 3, 2024 · 2 comments
Closed
1 task done

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

wozien opened this issue Apr 3, 2024 · 2 comments
Labels
next 2.0-next 版本的问题

Comments

@wozien
Copy link

wozien commented Apr 3, 2024

🏷 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)
@wjgogogo wjgogogo added the 🐛 bug 这个是一个 bug label Apr 3, 2024
@lijinke666
Copy link
Member

lijinke666 commented Apr 7, 2024

你这里关闭了格式化的配置, 所以未按 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;
+ }
});

@lijinke666 lijinke666 removed the 🐛 bug 这个是一个 bug label Apr 7, 2024
@antvis antvis deleted a comment from github-actions bot Apr 7, 2024
@wozien
Copy link
Author

wozien commented Apr 7, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题
Projects
None yet
Development

No branches or pull requests

3 participants