MCPcopy
hub / github.com/YMFE/yapi / tableBody

Function tableBody

common/markdown.js:209–223  ·  view source on GitHub ↗
(dataSource, columns, level)

Source from the content-addressed store, hash-verified

207}
208
209function tableBody(dataSource, columns, level) {
210 // 按照columns的顺序排列数据
211 let tpl = ``;
212 dataSource.map(col => {
213 let child = null;
214 tpl += `<tr key=${col.key}>${tableCol(col, columns, level)}</tr>`;
215 if (!_.isUndefined(col.children) && _.isArray(col.children)) {
216 let index = level + 1;
217 child = tableBody(col.children, columns, index);
218 }
219 tpl += child ? `${child}` : ``;
220 });
221
222 return tpl;
223}
224
225function createSchemaTable(body) {
226 let template = ``;

Callers 1

createSchemaTableFunction · 0.85

Calls 1

tableColFunction · 0.85

Tested by

no test coverage detected