# 无法让我的组件中的JS代码编译，错误：SyntaxError: 私有字段必须在封闭的类中使用

**URL:** https://meta.discourse.org/t/cannot-get-the-js-in-my-component-to-compile-syntaxerror-private-field-must-be-used-in-an-enclosing-class/327492
**Category:** Development
**Created:** [2024年九月21日 04:52 UTC](https://meta.discourse.org/t/cannot-get-the-js-in-my-component-to-compile-syntaxerror-private-field-must-be-used-in-an-enclosing-class/327492 "2024-09-21T04:52:21Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2024年九月21日 12:07 UTC](https://meta.discourse.org/t/cannot-get-the-js-in-my-component-to-compile-syntaxerror-private-field-must-be-used-in-an-enclosing-class/327492/5 "2024-09-21T12:07:37Z")

</div>

您似乎已经解决了您的问题，就像我写求助帖时经常做的那样。

[New Topic Header Button - #67 by patrickemin](https://meta.discourse.org/t/new-topic-header-button/84551/67) 提供了一个示例，并且可能正是您想要的。

另外，告诉您的工程师他们可以按“c”键来撰写消息。

---

_[View the full topic](https://meta.discourse.org/t/cannot-get-the-js-in-my-component-to-compile-syntaxerror-private-field-must-be-used-in-an-enclosing-class/327492)._
