[ { name: '123', type: 'menu', children: [{ name: '321', type: 'operation', children: null }], }, { name: '456', type: 'menu', children: [ { name: '654', type: 'menu', children: [{ name: '546', type: 'operation', children: null }], }, ], }, ];
这样一组数据
我想通过js 的map 取出所有type = "operation"的name 例如如上数据取出来的结果是
['321','546']
注意:实际的数据可能无线层嵌套
相关分类