在维护其文档时正确创建对象/类的字典

发布于 2025-02-11 02:52:46 字数 473 浏览 0 评论 0原文

如果我有一个具有文档的类listView,则将其放在字典中:

/** Handles list models */
class listView{}

const views = { list: listView }

属性/键list没有任何文档或IntelliSense。有没有办法让它显示parentView的文档而不复制它?

编辑:可以使用的一种方法是定义对象中的类:

const views = {
    /** Handles list models */
    list: class{ }
}

但是,如果存在更好的解决方案,请告诉我。

If I have a class listView that has documentation and I put it in a dictionary:

/** Handles list models */
class listView{}

const views = { list: listView }

Then the property/key list doesn't have any documentation or intellisense. Is there a way for me to have it show parentView's documentation without copying it?

Edit: One way that can work is to define the class within the object:

const views = {
    /** Handles list models */
    list: class{ }
}

But if a better solution exists, please let me know.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文