简体   繁体   中英

How do I comment object literals in YUIDoc

In YUIDoc, I want to comment object literals that are passed as parameters. 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.

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. 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
 */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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