# 自定义顶部导航链接组件在移动端似乎已损坏

**URL:** https://meta.discourse.org/t/custom-top-navigation-link-component-seems-to-be-broken-on-mobile/407511
**Category:** Bug
**Tags:** top-navigation-links
**Created:** [2026年七月13日 21:33 UTC](https://meta.discourse.org/t/custom-top-navigation-link-component-seems-to-be-broken-on-mobile/407511 "2026-07-13T21:33:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2026年七月13日 21:33 UTC](https://meta.discourse.org/t/custom-top-navigation-link-component-seems-to-be-broken-on-mobile/407511/1 "2026-07-13T21:33:55Z")

</div>

@akanora 在另一个话题中提到，该组件在移动端对他们不起作用：

> [@akanora](#):
>
> 我确实尝试过自定义顶部导航链接组件，但它导致该部分在移动端完全不显示。

我可以通过 [主题创建器预览](https://discourse.theme-creator.io/theme/Discourse/custom-top-navigation-links) 复现该问题：

在我的笔记本电脑上显示正常：

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/3/b/33bfb76754466ee2df41ef775277e273c51eb7e8.png)

但在我的手机上，顶部没有导航栏：

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/8/3/a83c760348655e0a9c486ae42bfdd09678d6254f.png)

* * *

我还想知道，隐藏类别面包屑导航似乎仅在我登录时才有效，这是否是有意为之？在我未登录时，它们是可见的：

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/7/5/a75869eea425f184d9578cd15c4ab40a6cb8d212.png)

---

<div class="post-metadata">

### Author: ![akanora](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/akanora/32/575035_2.png) [@akanora](https://meta.discourse.org/u/akanora)
#### Post date: [2026年七月14日 14:53 UTC](https://meta.discourse.org/t/custom-top-navigation-link-component-seems-to-be-broken-on-mobile/407511/2 "2026-07-14T14:53:52Z")

</div>

还有另一个问题也需要修复。

当使用 `New;topic created or replied to in the last few days;/new` 时，导航项不会像默认实现那样在括号中显示新主题的数量。例如，它只显示 **New** ，而不是显示 **New (5)**。

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2026年七月14日 16:16 UTC](https://meta.discourse.org/t/custom-top-navigation-link-component-seems-to-be-broken-on-mobile/407511/3 "2026-07-14T16:16:47Z")

</div>

感谢您的反馈！我正在进行一些重构工作，这将修复此问题（CSS 隐藏了过多内容），并包含迁移到对象类型设置的功能，这在配置方面更加友好。

> <https://github.com/discourse/Discourse-nav-links-component/pull/56>
>
> This updates the old list setting to the better structured objects type, and mig…rates existing settings to it (including a test). 
> 
> I've also fixed a CSS issue on narrow viewports when \`Hide\_dropdowns\` was enabled, it was unintentionally hiding the top\_menu rather than just the category and tag dropdowns. The initializer has also been refactored to be a bit simpler.

> [@akanora](#):
>
> 使用 `New;topic created or replied to in the last few days;/new` 时，导航项不会像默认实现那样在括号中显示新主题的数量。例如，它只显示 **New** ，而不是显示 **New (5)**。

我认为这实际上并不是一个 bug，更像是一个功能缺失……它并非旨在完全替代默认链接的功能，而只是对其进行补充。

---

<div class="post-metadata">

### Author: ![akanora](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/akanora/32/575035_2.png) [@akanora](https://meta.discourse.org/u/akanora)
#### Post date: [2026年七月17日 22:20 UTC](https://meta.discourse.org/t/custom-top-navigation-link-component-seems-to-be-broken-on-mobile/407511/4 "2026-07-17T22:20:20Z")

</div>

> [@awesomerobot](#):
>
> 我不认为这真的是一个bug，更像是一个功能的缺失……它并不是要完全取代默认的链接功能，只是作为补充

我明白它是作为补充而非替代，但没有计数功能，它基本上就失去了实用性。数字能让我一眼看出是否有值得查看的内容，以及有多少。没有它，我就得每次都点进去才能知道，这就完全违背了设置快速导航项的初衷。如果能添加计数功能，哪怕是作为一个可选设置，那就太好了。

与其取代默认标签页，它完全可以作为一个插入功能，保留所有默认项（A、B、C、D），并允许用户在其中任意位置插入自定义项，例如 A、B、“自定义”、C、D。
