评论Google表格自定义功能

时间:2019-08-25 08:05:14

标签: google-apps-script google-sheets jsdoc custom-function

我在Google表格中使用了自定义函数-但是,该函数具有许多可选参数-在帮助下,我想将任何可选参数的描述拆分为多行,是否可以?-< / p>

此功能供同事使用-可选参数需要清楚的说明-将多行输入时出现在表格上的支持注释分开非常有用。

这是我今天使用的自定义功能文本。

/**
 * Creates a section of random text based on parameters entered.
 *
 * @param {number} len The total number paragraphs to return.
 * @param {number} size Average size of paragraphs (0 - Short  >  3 - v.Long).
 * @param {string} optional TEXT I WOULD LIKE TO RETURN OVER MULTIPLE LINES: 
 * LINE 1 
 * LINE 2 
 * LINE 3
 * @return an array of random letters
 * @customfunction
 */
function HelpMePlease(len, size, optional) {

注意:我不想在此处注释代码>这是CustomFunction的注释>用户使用该功能时,我需要的文本将显示在表单中。

1 个答案:

答案 0 :(得分:0)

来自js文档:

具有属性的参数 如果期望参数具有特定属性,则可以通过提供其他@param标记来记录该属性。例如,如果期望员工参数具有名称和部门属性,则可以将其记录如下:


/**
 * Assign the project to an employee.
 * @param {Object} employee - The employee who is responsible for the project.
 * @param {string} employee.name - The name of the employee.
 * @param {string} employee.department - The employee's department.
 */
Project.prototype.assign = function(employee) {
    // ...
};

https://jsdoc.app/tags-param.html