# 在群组中为用户列表添加新列

**URL:** <https://meta.discourse.org/t/adding-new-columns-to-user-lists-in-groups/305598>\
**Category:** Development\
**Created:** [2024年四月26日 16:21 UTC](https://meta.discourse.org/t/adding-new-columns-to-user-lists-in-groups/305598 "2024-04-26T16:21:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [2024年四月26日 17:48 UTC](https://meta.discourse.org/t/adding-new-columns-to-user-lists-in-groups/305598/2 "2024-04-26T17:48:55Z")

</div>

你好，欢迎来到 Meta 👋  
你可以使用 `group-index-table-header-after-username` 和 `group-index-table-row-after-username` 出口来在用户名列旁边插入一个标题/行。

例如：

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/8/2/882389ce9e851d6dc18a81a4437744ea95ea5440.png)

对于标题，你可以使用 `TableHeaderToggle` 组件。  
对于行，你可以使用例如 `<div>{{this.args.member}}</div>` – 你可以通过 `{{this.args.member}}` 访问数据。

你需要修复网格 CSS 以包含新列。

```css
.group-members--can-manage {
    grid-template-columns: 3fr repeat(5, minmax(min-content, 1fr)) 3em;
                                      ^
}

```

如果你想移动列，由于 `display: contents` 的存在，定位会有点棘手；但是，使用 `order` 可以奏效。

另外，你可能会在获取用户状态时遇到问题。在我的测试中，数据没有在 `member` 中反映出来，用户被暂停或静默（`silencedTillDate` 或 `suspendedTillDate` 未定义）。我不确定这里是否存在 bug。目前我还没有深入研究！

希望这能帮到你。

---

_[View the full topic](https://meta.discourse.org/t/adding-new-columns-to-user-lists-in-groups/305598)._
