📅  最后修改于: 2022-03-11 15:04:32.452000             🧑  作者: Mango
function buildList(data) {
var $ul = $('
');
for (const key in data) {
var $child = $('');
$ul.append($child)
if (typeof data[key] === 'object') {
$child.text = $child.text(key);
$child.append(buildList(data[key]));
} else {
$child.text = $child.text(key + ' : ' + data[key]);
}
}
return $ul;
}