Javascript 为什么这个对象文本不呈现给JSDoc?
我有以下JavaScript 它是一个RequireJS模块,将其函数命名为对象文本。我提到:了解如何标记JSDoc符号 我在grunt任务中使用Javascript 为什么这个对象文本不呈现给JSDoc?,javascript,jsdoc,object-literal,jsdoc3,Javascript,Jsdoc,Object Literal,Jsdoc3,我有以下JavaScript 它是一个RequireJS模块,将其函数命名为对象文本。我提到:了解如何标记JSDoc符号 我在grunt任务中使用private:true运行JSDocs 3.3.0-beta3,但在模块页面上,publich方法没有私有方法或参数 /** * A module doing a lot of Foo. * @module Foo * @requires jquery * @author Markus Falk */ define(['jquery'],
private:true
运行JSDocs 3.3.0-beta3,但在模块页面上,publich方法没有私有方法或参数
/**
* A module doing a lot of Foo.
* @module Foo
* @requires jquery
* @author Markus Falk
*/
define(['jquery'], function($) {
'use strict';
/**
* @property {Object} Container
*/
var Foo = {
/**
* Caches all jQuery Objects for later use
* @function
* @private
*/
_cacheElements: function() {
this.$foo = $('.foo');
},
/**
* inits the app and returns the Message Text
* @function
* @public
* @param {Object} msg - The message.
* @param {string} msg.text - The message's Text.
* @param {string} msg.author - The message's author.
* @returns {String} Sentence with given message.text
*/
init: function(msg) {
this._cacheElements();
return "Say " + msg.text;
}
};
return /** @alias module:Foo */ {
/** init */
init: Foo.init
};
});
以下是此JSDoc代码的输出:
尝试
@function init
和@function\u cacheElements
/**
* A module representing a Foo.
* @module Foo
* @requires jquery
* @author Markus Falk
*/
define(['jquery'], function($) {
'use strict';
/**
* @property {Object} Container
*/
var Foo = {
/**
* Caches all jQuery Objects for later use
* @function _cacheElements
* @private
*/
_cacheElements: function() {
this.$foo = $('.foo');
},
/**
* inits the app and returns the Message Text
* @function init
* @public
* @param {Object} msg - The message.
* @param {string} msg.text - The message's Text.
* @param {string} msg.author - The message's author.
* @returns {String} Sentence with given message.text
*/
init: function(msg) {
this._cacheElements();
return "Say " + msg.text;
}
};
return /** @alias module:Foo */ {
/** init */
init: Foo.init
};
});
我正在使用3.3.0-beta3和grunt,其中默认显示私有函数。然而,它仍然不会像你那样出现。现在我知道你做了什么。这是名称空间页面。如果我想让所有这些都出现在模块部分呢?