简体   繁体   English

如何在YUIDoc中注释对象文字

[英]How do I comment object literals in YUIDoc

In YUIDoc, I want to comment object literals that are passed as parameters. 在YUIDoc中,我想注释作为参数传递的对象文字。 See the following snippet of code: 请参见以下代码段:

@param {Array} colDefs Array of object literal column definitions for the grid<ul>
    <li>title -  Column header display</li>
    <li>key -  The key of the column from the JSON data array</li>
    <li>type - The data type of the column.  </li></ul>

What tags do I add to list items so I can specify the type of property (String, Object, etc)? 我应在列表项中添加哪些标签,以便可以指定属性的类型(字符串,对象等)? If I add {String} it just shows up as the text, not the nice formatting that I get with @param tags. 如果我添加{String},它只会显示为文本,而不是@param标记的格式。

Perhaps this is not even possible? 也许这甚至是不可能的?

You can document configuration objects by specifying first the configuration object and then all the properties as object.property parameters. 您可以通过首先指定配置对象,然后指定所有属性作为object.property参数来记录配置对象。 It looks like this: 看起来像这样:

 /**
 @param {Object}  config          Object literal containing configuration parameters
 @param {Boolean} config.useFoo   Whether to use Foo or not
 @param {String}  [config.option] An optional string parameter
 */

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM