我有以下 JSON:
"daysRange": {
"status": "UNSPECIFIED/ALL/SPECIFIED",
"available": [
{
"id": "1",
"name": "MONDAY"
},
{
"id": "2",
"name": "TUESDAY"
},
{
"id": "3",
"name": "WEDNESDAY"
},
{
"id": "4",
"name": "THURSDAY"
},
{
"id": "5",
"name": "FRIDAY"
},
{
"id": "6",
"name": "SATURDAY"
},
{
"id": "7",
"name": "SUNDAY"
}
],
"selected": [
{
"id": "2",
"name": "TUESDAY"
}
]
}
我正在使用这样的车把来生成 li:
<ul class="available">
{{#each daysRange.available}}
<li data-id="{{this.id}}">{{this.name}}</li>
{{/each}}
</ul>
问题:如何将所选课程添加到所选日期?我会很感激有人可以对此有所了解。