# Form toolkit——无法使 tooltip 与组件按照文档主题或测试中描述的方式正常工作

**URL:** <https://meta.discourse.org/t/form-toolkit-cant-get-tooltip-to-work-with-component-as-described-in-doc-topic-or-in-tests/366561>\
**Category:** Development\
**Created:** [2025 年5 月 17 日 16:59 UTC](https://meta.discourse.org/t/form-toolkit-cant-get-tooltip-to-work-with-component-as-described-in-doc-topic-or-in-tests/366561 "2025-05-17T16:59:12Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

作者： ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
发布日期： [2025 年5 月 20 日 22:29 UTC](https://meta.discourse.org/t/form-toolkit-cant-get-tooltip-to-work-with-component-as-described-in-doc-topic-or-in-tests/366561/3 "2025-05-20T22:29:33Z")

</div>

当我做类似的事情时，工具提示只是添加到字段名称上。

`@tooltip` 只需要一个字符串。一旦我意识到这一点，我就写了一个函数返回类似的字符串

```plaintext
  @action
  tooltipText(field) {
    return i18n("pfaffmanager.help." + field + "_tooltip");
  }
...
               orm.Field
              @name="install_type"
              @format="large"
              @translatedLabel="香蕉很好吃"
              @validation="required"
              @tooltip={{this.tooltipText "install_type"}}
              @class="install-field"
              @title="安装类型"
              {{! @description="description." }}
              as |field|
            
              field.Select
                {{on "focus" (fn this.fieldClicked "install_type")}}
                as |select|
              

```

这似乎是文档错误的另一种情况。

---

_[View the full topic](https://meta.discourse.org/t/form-toolkit-cant-get-tooltip-to-work-with-component-as-described-in-doc-topic-or-in-tests/366561)._
