如何正确缩进(对齐)溢出行标签? - (蚂蚁设计表,树数据)

发布于 2025-02-12 01:47:29 字数 762 浏览 0 评论 0原文

我正在构建一个自定义组件,在其中使用Ant Design提供的表组件。对于大多数零件,一切都按预期工作,但是存在一个“小”问题。

我正在使用“树数据”(即嵌套的JSON)数据来填充 Table 组件。由于固定的列大小(这是一项要求),因此在质量检查期间已注意到 Row的标签如果溢出(即在新行开始)。

因此,我的问题是,如何缩进标签,以便当标签在新线上启动时,它是从这样的初始凹痕开始的:

目标将是将标签“挤压”在绿色破折的容器中。

此链接 您可以找到一个演示(与蚂蚁设计文档中的次要更改相同),该演示复制了我正在处理的问题。

  1. 打开链接
  2. 扩展第一行(即John Brown Sr。),因为它在上图中扩展。

I am building a custom component where I am using the table component provided by Ant Design. For most of the parts, everything works as expected, however, there is a "tiny" issue.

I am using the "tree-data" (i.e. nested JSON) data to populate the Table component. Due to the fixed column size (which is a requirement) it has been noted during QA that the row`s label is not properly indented if it overflows (i.e. starts on a new row).

So my question is, how can indent the label such that when the label starts on a new line it starts from the initial indentation like this:
enter image description here

The GOAL would be to have the label "squeezed" within the green-dashed container.

On THIS LINK you can find a demo (the same as the one in ant design documentation with minor changes) which replicates the issue I am working on.

  1. open the link
  2. expand the first row (i.e. John Brown sr.) as it is expanded in the picture above.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

零時差 2025-02-19 01:47:29

您可以将显示“ Flex”应用于列

// index.css
.name-column {
  display: flex;
}

// demo.js
// column
...
...
...
    {
      title: "Name",
      dataIndex: "name",
      key: "name",
      className: 'name-column'
    },
...
...
...

You can apply display 'flex' to the column

// index.css
.name-column {
  display: flex;
}

// demo.js
// column
...
...
...
    {
      title: "Name",
      dataIndex: "name",
      key: "name",
      className: 'name-column'
    },
...
...
...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文