@defaultValue
标准化 | 扩展 |
语法种类 | 块标签 |
用法
此块标签用于记录字段或属性的默认值(如果未显式分配值)。
此标签应仅与 TypeScript class
或 interface
的成员字段或属性一起使用。
示例
enum WarningStyle {
DialogBox,
StatusMessage,
LogOnly
}
interface IWarningOptions {
/**
* Determines how the warning will be displayed.
*
* @remarks
* See {@link WarningStyle| the WarningStyle enum} for more details.
*
* @defaultValue `WarningStyle.DialogBox`
*/
warningStyle?: WarningStyle;
/**
* Whether the warning can interrupt a user's current activity.
* @defaultValue
* The default is `true` unless
* `WarningStyle.StatusMessage` was requested.
*/
cancellable?: boolean;
/**
* The warning message
*/
message: string;
}
另请参阅
- RFC #27:
@defaultValue
用于指示默认值