# 扩展头部按钮

**URL:** https://meta.discourse.org/t/extending-header-buttons/337462
**Category:** Development
**Created:** [2024年十一月21日 09:03 UTC](https://meta.discourse.org/t/extending-header-buttons/337462 "2024-11-21T09:03:24Z")
**Posts on this page:** 1
**Showing post:** 32

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [2024年十一月22日 16:22 UTC](https://meta.discourse.org/t/extending-header-buttons/337462/32 "2024-11-22T16:22:23Z")

</div>

基本上无法覆盖 [discourse/app/assets/javascripts/discourse/app/components/header/auth-buttons.gjs at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/header/auth-buttons.gjs) 模板，但我们可以在登录按钮之前或之后添加一个标题按钮。  
因此，该组件会在登录按钮之前添加一个按钮，就像这里解释的那样：[Upcoming Header Changes - Preparing Themes and Plugins](https://meta.discourse.org/t/upcoming-header-changes-preparing-themes-and-plugins/296544#p-1461486-decoratewidgetheader-buttons-8%EF%BC%8C%E5%B9%B6%E4%BD%BF%E7%94%A8) CSS 隐藏默认的注册按钮。

---

_[View the full topic](https://meta.discourse.org/t/extending-header-buttons/337462)._
