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

🤔明细表如何实现自定义单元格内容,例如说在单元格的数字里添加符号 #2420

Closed
5 tasks
18211365467 opened this issue Nov 17, 2023 · 2 comments
Labels
❔question 疑问/使用问题

Comments

@18211365467
Copy link

🏷 Version

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

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

🔗 Reproduce Link

😊 Expected Behavior

😅 Current Behavior

@18211365467 18211365467 added the ❔question 疑问/使用问题 label Nov 17, 2023
@xu-yi-hang
Copy link

meta data

@lijinke666
Copy link
Member

通过 s2DataConfig.meta 配置字段的格式化即可。请仔细阅读文档后再提问,感谢。 https://s2.antv.antgroup.com/api/general/s2-data-config#meta

  const s2DataConfig = {
    data,
    fields: {
      columns: ['province', 'city', 'type', 'price', 'cost'],
    },
+    meta: [
+      {
+        field: 'city',
+        name: '城市',
+        formatter: (value) => `${value}-@`
+      },
   ]
 };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❔question 疑问/使用问题
Projects
None yet
Development

No branches or pull requests

3 participants