Jea*_*eri 7 javascript documentation yuidoc
我正在尝试使用YUIDoc为JavaScript方法编写一些文档.看起来像:
/**
Returns an instance of className
@method getInstance
@param {string} className the of the class used to create the instance
@param {Object} options these are options used to create the instance
**/
function getInstance(className, options) { ..... }
Run Code Online (Sandbox Code Playgroud)
现在,选择对象可以有几个参数,如options.id,options.single等.
如何将此信息添加到此文档中@param?
参考:http://yui.github.com/yuidoc/syntax/index.html
"如示例所示,您还可以嵌套@param标记.这使您可以记录具有自己特定嵌套结构的对象参数."
@param {Object} [options] Data
to be mixed into the event
facade of the `change`
event(s) for these attributes.
@param {Boolean} [options.silent]
If `true`, no `change` event
will be fired.
Run Code Online (Sandbox Code Playgroud)
小智 5
在YUIDOC 0.3.45中,这是编写本文时的当前版本,为了描述通过方法接收的对象,您应首先声明对象(选项,在下面的示例中),然后使用点符号表示它的属性(例如,options.url).
/**
* Describe your method
*
* @method yourMethodName
* @param {object} options - These are the options you may pass
* @param {string} options.url - the url
* @param {string} options.otherOption - description of other option
*/
Run Code Online (Sandbox Code Playgroud)