UNPKG

t-fighting-design

Version:

Fighting design can quickly build interactive interfaces in vue3 applications, which looks good.

2 lines (1 loc) 479 B
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=s=>{const r=[];return s.forEach(e=>{const l={label:e.label,level:e.level,index:e.index,show:e.show};r.push(l),e.children&&r.push(...t(e.children))}),r},c=s=>{if(!Array.isArray(s))return[];const r=(e,l=0)=>(l++,e.map((n,u)=>{n.level=l,n.index=u,n.show=!1;const o=n.children;return o&&o.length&&r(o,l),n}));return r(s)};exports.treeAddLevel=c;exports.treeToFlat=t;