[O] Remove unnecessary getAssignmentTypes()
This commit is contained in:
@@ -14,8 +14,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<AssignmentTypeHead v-for="type in getAssignmentTypes()" :key="type"
|
<AssignmentTypeHead v-for="type in course.assignmentTypes" :key="type.id"
|
||||||
:type-name="type" :assignments="course.assignments">
|
:type="type" :assignments="course.assignments">
|
||||||
</AssignmentTypeHead>
|
</AssignmentTypeHead>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -51,21 +51,6 @@
|
|||||||
}
|
}
|
||||||
else return this.unread;
|
else return this.unread;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all the types of the assignments.
|
|
||||||
*/
|
|
||||||
getAssignmentTypes(): string[]
|
|
||||||
{
|
|
||||||
// Get all types
|
|
||||||
let types = this.course.assignments.map(a => a.type);
|
|
||||||
|
|
||||||
// Remove duplicates
|
|
||||||
types = types.filter((type, i, a) => a.indexOf(type) == i);
|
|
||||||
|
|
||||||
// Return it
|
|
||||||
return types;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user