something like this
const demo = [{
path: "/login",
name: "login",
meta: {
title: "Login - ",
hideInMenu: true
}
},
{
path: "/",
name: "_home",
redirect: "/home",
meta: {
hideInMenu: true,
notCache: true
},
children: [{
path: "/home",
name: "home",
meta: {
hideInMenu: true,
title: "",
notCache: true,
icon: "md-home"
}
}]
},
{
path: "/system",
name: "system",
meta: {
icon: "md-menu",
title: ""
},
children: [{
path: "user",
name: "user",
meta: {
icon: "ios-people-outline",
title: ""
}
},
{
path: "menus",
name: "menus",
meta: {
icon: "md-funnel",
title: ""
}
},
{
path: "character",
name: "character",
meta: {
icon: "md-funnel",
title: ""
}
}
]
},
{
path: "/401",
name: "error_401",
meta: {
hideInMenu: true
}
},
{
path: "/500",
name: "error_500",
meta: {
hideInMenu: true
}
},
{
path: "*",
name: "error_404",
meta: {
hideInMenu: true
}
}
]
convert to this
const demo1=[
{
title:"",
children:[
{
title:""
},
{
title:""
},
{
title:""
}
]
}
]
it can be realized with for that you don"t know how to write it with recursion