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

🤔 #2525

Closed
1 of 5 tasks
QJerryxjh opened this issue Jan 19, 2024 · 3 comments
Closed
1 of 5 tasks

🤔 #2525

QJerryxjh opened this issue Jan 19, 2024 · 3 comments
Labels
❔question 疑问/使用问题

Comments

@QJerryxjh
Copy link

🏷 Version

Package Version
@antv/s2 1.54.2
@antv/s2-react 1.46.0

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

官网明细表隐藏表头示例,展示动图可以点击隐藏表头,在实例内showTooltip和hiddenColumns为true了,但是表头那没有出现,hiddenColumns是控制是否展示隐藏按钮的吗,还需要其他的设置吗

tooltip: {
        showTooltip: true,
        operation: {
          // 开启手动隐藏
          hiddenColumns: true,
        },
      },

🔗 Reproduce Link

s2官网示例

😊 Expected Behavior

😅 Current Behavior

@QJerryxjh QJerryxjh added the ❔question 疑问/使用问题 label Jan 19, 2024
Copy link
Contributor

你好 @QJerryxjh,请编辑你的 issue 标题, 一个言简意赅的 issue 标题可以节省大家的时间, 请不要将标题当做正文, 或者为空。

Hello, @QJerryxjh, please edit your issue title. a concise issue title will save everyone time. please do not leave the title as the body or empty.

@lijinke666
Copy link
Member

官网明细表隐藏表头示例,展示动图可以点击隐藏表头

  • s2Options.tooltip.operation.hiddenColumns 控制是否允许手动点击隐藏 ( 列头 tooltip 中的小眼睛 icon)
  • s2Options.interaction.hiddenColumnFields 控制默认隐藏的列头

@antv/s2 没有实现 tooltip 的 UI, 所以点击列头不会展示 tooltip, 官网这里有说明

@antv/s2-react 是基于 antd 封装的 UI, 你反馈的这个 Demo 对应的 gif 有点问题, gif 录制的时候用的是 React 版本的, 代码示例又是用的 @antv/s2, 所以造成误解了, 后续我们更换一下 gif, 抱歉, 可以查看 React 版本的 demo, 这个是正确的

还需要其他的设置吗

image

你使用的 React 版本, 所以不会有这个问题, 只需要引入相应的样式即可, 可以这样理解:

@antv/s2 提供手动隐藏的能力和相应 API, 只支持控制默认隐藏的列头, 如果想手动点击列头隐藏, 需要自己实现 Tooltip 的 UI, 然后调用相应的 API

@antv/s2-react 是基于上诉步骤封装的, 所以可以直接使用.

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

2 participants