使用JSDoc编写的jQuery插件文档

6

我想知道如何使用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,但它无法正常工作。

1个回答

7

根据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
 */

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接