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 用的不熟悉,不知道怎么转
请问有人知道吗?

阅读 1.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题