我想知道如何通过使用JSDoc记录jQuery插件?我的代码是:
/**
* The default configurations of comments
* @typedef {Object} CommentConfig
...
*/
/**
* Show comments
* @method comments
* @version 1.0.1
* @param {CommentConfig} options Configuration of comment
*/
$.fn.comments = function (options) {
// ..
}
我想让@method
是$.fn.comments
,但它不起作用
根据JSDoc3文档,您应该在您的情况下使用@external
:
/**
* The jQuery plugin namespace.
* @external "jQuery.fn"
* @see {@link http://docs.jquery.com/Plugins/Authoring The jQuery Plugin Guide}
*/
/**
* Show comments
* @function external:"jQuery.fn".comments
*/