传入的参数如下:[{"id":"02c76c921d5011e987c600163e0e2174","code":"02c76c921d5011e987c600163e0e2174","fullTitle":"test,test-t","parentId":"e8bbcff61d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"parent":{"id":"e8bbcff61d4f11e987c600163e0e2174","code":"e8bbcff61d4f11e987c600163e0e2174","fullTitle":"test","parentId":0,"_checked":false,"isChecked":false,"children":[null,{"id":"2473dea61d5011e987c600163e0e2174","code":"2473dea61d5011e987c600163e0e2174","fullTitle":"test,test-e","parentId":"e8bbcff61d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"34","seq":2,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"}],"selected":false,"hovered":false,"expanded":true,"load":true,"parent":null,"level":1,"isShow":true,"spaceHtml":"","hasChildren":true,"sort":401,"seq":6,"isLabelShow":true,"isInputShow":false,"showInput":false},"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"234","seq":1,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"},{"id":"02c76c921d5011e987c600163e0e2174","code":"02c76c921d5011e987c600163e0e2174","fullTitle":"test,test-e","parentId":"e8bbcff61d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"parent":{"id":"e8bbcff61d4f11e987c600163e0e2174","code":"e8bbcff61d4f11e987c600163e0e2174","fullTitle":"test","parentId":0,"_checked":false,"isChecked":false,"children":[null,{"id":"2473dea61d5011e987c600163e0e2174","code":"2473dea61d5011e987c600163e0e2174","fullTitle":"test,test-e","parentId":"e8bbcff61d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"34","seq":2,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"}],"selected":false,"hovered":false,"expanded":true,"load":true,"parent":null,"level":1,"isShow":true,"spaceHtml":"","hasChildren":true,"sort":401,"seq":6,"isLabelShow":true,"isInputShow":false,"showInput":false},"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"234","seq":1,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"},{"id":"35f29a5e1d5011e987c600163e0e2174","code":"35f29a5e1d5011e987c600163e0e2174","fullTitle":"test-sun,test-u","parentId":"f24bd87b1d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":true,"hovered":false,"expanded":true,"load":true,"parent":{"id":"f24bd87b1d4f11e987c600163e0e2174","code":"f24bd87b1d4f11e987c600163e0e2174","fullTitle":"test-sun","parentId":0,"_checked":false,"isChecked":false,"children":[null,{"id":"0ef954591d5011e987c600163e0e2174","code":"0ef954591d5011e987c600163e0e2174","fullTitle":"test-sun,test-s","parentId":"f24bd87b1d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"456","seq":2,"isLabelShow":false,"isInputShow":true,"showInput":false,"type":"editSort"}],"selected":false,"hovered":false,"expanded":true,"load":true,"parent":null,"level":1,"isShow":true,"spaceHtml":"","hasChildren":true,"sort":402,"seq":7,"isLabelShow":true,"isInputShow":false,"showInput":false},"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"454","seq":1,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"},{"id":"02c76c921d5011e987c600163e0e2174","code":"02c76c921d5011e987c600163e0e2174","fullTitle":"test,test-n","parentId":"e8bbcff61d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"parent":{"id":"e8bbcff61d4f11e987c600163e0e2174","code":"e8bbcff61d4f11e987c600163e0e2174","fullTitle":"test","parentId":0,"_checked":false,"isChecked":false,"children":[null,{"id":"2473dea61d5011e987c600163e0e2174","code":"2473dea61d5011e987c600163e0e2174","fullTitle":"test,test-e","parentId":"e8bbcff61d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"34","seq":2,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"}],"selected":false,"hovered":false,"expanded":true,"load":true,"parent":null,"level":1,"isShow":true,"spaceHtml":"","hasChildren":true,"sort":401,"seq":6,"isLabelShow":true,"isInputShow":false,"showInput":false},"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"234","seq":1,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"}]letstr=JSON.stringify(pd,function(key:any,value:any){if(typeofvalue==='object'&&value!==null){if(cache.indexOf(value)!==-1){return;}cache.push(value);}returnvalue;});用的是将上面那段代码去转换,结果应该返回的是一个数组里面有四个对象,但是其中两个却变为null,求解!谢谢![{"id":"02c76c921d5011e987c600163e0e2174","code":"02c76c921d5011e987c600163e0e2174","fullTitle":"test,test-t","parentId":"e8bbcff61d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"parent":{"id":"e8bbcff61d4f11e987c600163e0e2174","code":"e8bbcff61d4f11e987c600163e0e2174","fullTitle":"test","parentId":0,"_checked":false,"isChecked":false,"children":[null,{"id":"2473dea61d5011e987c600163e0e2174","code":"2473dea61d5011e987c600163e0e2174","fullTitle":"test,test-e","parentId":"e8bbcff61d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"34","seq":2,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"}],"selected":false,"hovered":false,"expanded":true,"load":true,"parent":null,"level":1,"isShow":true,"spaceHtml":"","hasChildren":true,"sort":401,"seq":6,"isLabelShow":true,"isInputShow":false,"showInput":false},"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"234","seq":1,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"},null,{"id":"35f29a5e1d5011e987c600163e0e2174","code":"35f29a5e1d5011e987c600163e0e2174","fullTitle":"test-sun,test-u","parentId":"f24bd87b1d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":true,"hovered":false,"expanded":true,"load":true,"parent":{"id":"f24bd87b1d4f11e987c600163e0e2174","code":"f24bd87b1d4f11e987c600163e0e2174","fullTitle":"test-sun","parentId":0,"_checked":false,"isChecked":false,"children":[null,{"id":"0ef954591d5011e987c600163e0e2174","code":"0ef954591d5011e987c600163e0e2174","fullTitle":"test-sun,test-s","parentId":"f24bd87b1d4f11e987c600163e0e2174","_checked":false,"isChecked":false,"selected":false,"hovered":false,"expanded":true,"load":true,"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"456","seq":2,"isLabelShow":false,"isInputShow":true,"showInput":false,"type":"editSort"}],"selected":false,"hovered":false,"expanded":true,"load":true,"parent":null,"level":1,"isShow":true,"spaceHtml":"","hasChildren":true,"sort":402,"seq":7,"isLabelShow":true,"isInputShow":false,"showInput":false},"level":2,"isShow":true,"spaceHtml":"","hasChildren":false,"sort":"454","seq":1,"isLabelShow":true,"isInputShow":false,"showInput":false,"type":"editSort"},null]
开满天机
慕的地10843
相关分类