- 0133技术站
- 联系QQ:18840023
- QQ交流群

- 微信公众号

描述:标记为只读的。
标记一个标识符为只读。jsdoc不会检查某个代码是否真是只读的,只要标上@readonly,在文档中就体现为只读的。
例如,使用@readonly标签:
/** * A constant. * @readonly * @const {number} */ const FOO = 1;
例如,给getter标记为只读:
/** * Options for ordering a delicious slice of pie. * @namespace */var pieOptions = { /** * Plain. */ plain: 'pie', /** * A la mode. * @readonly */ get aLaMode() { return this.plain + ' with ice cream'; } };
推荐手册