TypeDoc:如何使React组件的props显示/列表与组件文档在同一页面上?

问题描述 投票:0回答:1
/**
  * Interface of props of the Component
  */
export interface ComponentProps {
  /**
   * Name of sth
   */
  name: string,
  /**
   * happening on click component
   */
  onClick: () => void
}

/**
 * @category Component
 */
export function Component({ name, onClick }: ComponentProps) {
  (...)
}

当我通过 typedoc 生成文档时,我得到了两页:

  1. Component
    页面,其道具表示为
    __namedParameters: ComponentProps
    (其中
    ComponentProps
    已链接,这是可以的)
  2. ComponentProps
    包含类型和名称列表的页面

我可以以某种方式在

Component
页面上显示/列出带有类型的道具吗?

reactjs typescript typedoc
1个回答
0
投票

我认为这是不可能的。 TypeDoc 在其自己的页面中生成每个函数/变量/类型。这通常是 API 文档的结构方式。您应该能够在生成的模块页面中看到它们的索引。

© www.soinside.com 2019 - 2024. All rights reserved.