【问题标题】:jQuery plugin documentation with JSDoc带有 JSDoc 的 jQuery 插件文档
【发布时间】:2014-09-14 02:54:32
【问题描述】:

我想知道如何使用 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,但它不起作用。

【问题讨论】:

    标签: javascript jquery jsdoc jsdoc3


    【解决方案1】:

    根据JSDoc3 docs,您应该在您的情况下使用@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
     */
    

    【讨论】:

      猜你喜欢
      • 2012-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-26
      • 1970-01-01
      相关资源
      最近更新 更多