MCPcopy
hub / github.com/baidu/amis / convertArray2Hbox

Function convertArray2Hbox

packages/amis/src/compat.ts:165–183  ·  view source on GitHub ↗
(arr: Array<any>)

Source from the content-addressed store, hash-verified

163// Form 里面的 Tabs 中把 controls 里面的数组用法转成 {type: 'group', controls: []}
164
165function convertArray2Hbox(arr: Array<any>): any {
166 let flag = false;
167 let converted = arr.map((item: any) => {
168 if (Array.isArray(item)) {
169 flag = true;
170 return convertArray2Hbox(item);
171 }
172
173 return item;
174 });
175 if (!flag) {
176 converted = arr;
177 }
178
179 return {
180 type: 'hbox',
181 columns: converted
182 };
183}
184
185// CRUD/List 和 CRUD/Card 的 body 中的数组用法转成 hbox
186addSchemaFilter(function (schema: Schema, renderer) {

Callers 1

compat.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected