Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.4k views
in Technique[技术] by (71.8m points)

json-templater 转复杂数组对象 问题

参考elementui的入口build文件写的

image.png

现在出现一个问题:

即 router 里的children数据结构是

{
 path: '/home/index',
 name: 'home',
 component: () => import('../views/home/index')
},
{
 path: '/home/index',
 name: 'home',
 component: () => import('../views/home/index')
},

转出的格式却是

  children: [
 {"path":"/home/index","name":"首页","component":"() => import('../views/home/index.vue')"},
 {"path":"/about","name":"测试1","component":"() => import('../views/home/err.vue')"},
 {"path":"/about","name":"测试2","component":"() => import('../views/abc/about.vue')"}]
},

而想要最终的数据是

children:[{ 
     path: '/home/index',
     name: 'home',
     component: () => import('../views/home/index')
 },{ 
     path: '/home/index',
     name: 'home',
     component: () => import('../views/home/index')
 }]

json-templater 用的不熟悉,不知道怎么转
请问有人知道吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...