JSDoc 中文网

Synonyms

语法

¥Syntax

@default [<some value>]

概述

¥Overview

@default 标签允许你记录符号的指定值。你可以自己为这个标签提供一个值,也可以允许 JSDoc 自动记录源代码中的值 - 只有当记录的符号被分配一个单一的、简单的值时才可能,该值是:字符串、数字、布尔值或 null。

¥The @default tag allows you to document the assigned value of a symbol. You can supply this tag with a value yourself or you can allow JSDoc to automatically document the value from the source code -- only possible when the documented symbol is being assigned a single, simple value that is either: a string, a number, a boolean or null.

示例

¥Examples

在此示例中记录了一个常量。常量的值为 0xff0000。通过添加 @default 标签,该值会自动添加到文档中。

¥In this example a constant is documented. The value of the constant is 0xff0000. By adding the @default tag this value is automatically added to the documentation.

记录常量的数值
/**

 *  @constant

 *  @default
 */
const RED = 0xff0000;