How can I get JSDoc to mark my param as a jQuery object?

杀马特。学长 韩版系。学妹 提交于 2019-12-22 01:13:28

问题


I'm attempting to thoroughly comment my JavaScript and I'm using JSDoc. I have a function that consumes a jQuery object and I'd like to mark the parameter as such.

Currently, I have this:

/**
 * Initializes a login object.
 * @param formEl {JQuery} The login form element on the page.
 */
var login = function(formEl){ ... }

But JSDoc doesn't recognize (or properly format) "JQuery" as a variable type. Any help?


回答1:


According to http://code.google.com/p/jsdoc-toolkit/wiki/TagParam it should be

Param type before param name.

/**
 * Initializes a login object.
 * @param {jQuery} formEl The login form element on the page.
 */
var login = function(formEl){ ... }


来源:https://stackoverflow.com/questions/13610979/how-can-i-get-jsdoc-to-mark-my-param-as-a-jquery-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!