zTree所有节点都显示undefined,最后发现后台传过来的数据如下:
[{"OPEN":"true","NAME":"33","PID":"-1","ID":"465b0d7696c146b1ae63a7a308c884ab"},{"OPEN":"true","NAME":"问问2","PID":"-1","ID":"9e8014b18226426f8b57a198556d6d4d"},{"OPEN":"true","NAME":"集团公司","PID":"-1","ID":"d4b420e4d9b940d0b07c7660d0bfd921"}]
所有的key都为大写,于是使用str.toLowerCase()将其转换成小写,随后所有节点正常显示。
(这只是一种情况,具体情况具体分析)
时间: 2024-10-03 18:17:18