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

🐛SheetComponent 里面设置的 cell 高度没有生效

egolink0 opened this issue · comments

commented

🏷 Version

Package Version
@antv/s2 2.0.0-next.21
@antv/s2-react 2.0.0-next.20
@antv/s2-vue

Sheet Type

  • PivotSheet
  • TableSheet(SheetComponent)
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

⌨️ Code Snapshots

 const s2Options: S2Options = {
      width: 600,
      height: 480,
      style: {
        // 列头宽度始终和数值单元格一致
        dataCell: {
          width: 200,
          height: 50, // 高度没生效
        },
        colCell: {
          width: 200,
          height: 50,
          widthByField: {
            // 特定维度 (如: 城市)
            city: 100,
            // 特定维值 (明细表场景下等同于配置特定维度)
            "root[&]province": 80,
          },
        },
        rowCell: {
          // 设置行高
          height: 40,
          // 明细表每一行根据行索引单独设置 (从 0 开始)
          heightByField: {
            "0": 40,
            "1": 130,
            "3": 60,
            "10": 80,
            "15": 20,
          },
        },
      },
    };

🔗 Reproduce Link

🤔 Steps to Reproduce

sandbox

😊 Expected Behavior

预期应该根据高度设置的值变化,但现在并没有变化

😅 Current Behavior

💻 System information

Environment Info
System linux deepin
Browser chrome 122

Demo 示例只是演示一下各种配置如何写, 优先级规则是 rowCell.heightByField > rowCell.height > dataCell.height (后面再完善下文档吧)

image

image

所以这里 dataCell.height 是不生效的, 你想设置明细表的行头, 直接使用 rowCell.height 就行了