@static¶
-
.. @static::
¶ - 语法
@static
- 概述
The @static tag indicates that a symbol is contained within a parent and can be accessed without instantiating the parent.
Using the @static tag will override a symbol’s default scope, with one exception: Symbols in global scope will remain global.
- 示例
The following example has the same effect as writing “@function MyNamespace.myFunction” and omitting the @memberof and @static tags:
Using @static in a virtual comment¶/** @namespace MyNamespace */ /** * @function myFunction * @memberof MyNamespace * @static */
The following example forces a module’s inner member to be documented as a static member:
Using @static to override the default scope¶/** @module Rollerskate */ /** * The 'wheel' variable is documented as Rollerskate.wheel * rather than Rollerskate~wheel. * @static */ var wheel = 1;