JSDoc 中文网

概述

¥Overview

使用 @inner 标签会将符号标记为其父符号的内部成员。这意味着它可以被 "父~子" 引用。

¥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 将覆盖 doclet 的默认范围(除非它位于全局范围内,在这种情况下它将保持全局)。

¥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 使虚拟 doclet 成为内部成员
/** @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.