答案 0 :(得分:1)
以下是嵌套下拉列表的示例。
const groupedByMonthData = {
"July": [
{
"created_at": "2017-07-13 07:23:14",
"date_from": "2017-07-18 00:00:00",
"date_to": "2017-07-18 23:59:59",
"is_new": false
}
],
"August": [
{
"created_at": "2017-07-13 07:24:34",
"date_from": "2017-08-08 00:00:00",
"date_to": "2017-08-09 23:59:59",
"is_new": true
}
]
}
let hasIsNew = Object.keys(groupedByMonthData).map( month =>
groupedByMonthData[month].some( obj => obj.is_new ) )
console.log(hasIsNew.join("\n"));

$('.dropdown-submenu a.test').on("click", function(e){
$(this).next('ul').toggle();
e.stopPropagation();
e.preventDefault();
});