查看“︁JavaScript/typescript/typeof”︁的源代码
来自康健生活
←
JavaScript/typescript/typeof
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 引言 == == const == === readonly === === 联合类型 === typeof 操作符配合 const 断言获取元组中元素值的联合类型。 <syntaxhighlight lang="javascript"> /** * 设置 button 原生的 type 值。htmlType */ export const ButtonProtoTypes = [ "button", "reset", "submit" ] as const; /** * 设置 button 的基础各种 type * typeof 操作符配合 const 断言获取元组中元素值的联合类型 */ export interface ButtonBaseTypes { htmlType?: typeof ButtonProtoTypes[number]; // 等于于 // htmlType?: "button" | "reset" | "submit"; } </syntaxhighlight>
返回
JavaScript/typescript/typeof
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。