JSDoc 中文网

概述

🌐 Overview

使用 @inner 标签会将一个符号标记为其父符号的内部成员。这意味着它可以通过 "Parent~Child" 来引用。

🌐 Using the @inner tag will mark a symbol as an inner member of its parent symbol. This means it can be referred to by "Parent~Child".

使用 @inner 将覆盖文档元素的默认作用域(除非它处于全局作用域,在这种情况下它将保持全局)。

🌐 Using @inner will override a doclet's default scope (unless it is in the global scope, in which case it will remain global).

示例

🌐 Examples

使用 @inner 将虚拟文档成员设为内部成员
/** @namespace MyNamespace */
/**
 * myFunction is now MyNamespace~myFunction.
 * @function myFunction
 * @memberof MyNamespace
 * @inner
 */

请注意,在上述内容中,我们本可以使用“@function MyNamespace~myFunction”来替代 @memberof 和 @inner 标签。

🌐 Note that in the above we could have used "@function MyNamespace~myFunction" instead of the @memberof and @inner tags.

使用 @inner
/** @namespace */
var MyNamespace = {
    /**
     * foo is now MyNamespace~foo rather than MyNamespace.foo.
     * @inner
     */
    foo: 1
};

在上面的例子中,我们使用 @inner 强制将命名空间的成员记录为内部成员(默认情况下,它将是一个静态成员)。这意味着 foo 现在的完整名称是 MyNamespace~foo,而不是 MyNamespace.foo

🌐 In the above example, we use @inner to force a member of a namespace to be documented as an inner member (by default, it would be a static member). This means that foo now has the longname MyNamespace~foo instead of MyNamespace.foo.