diff --git a/src/components/StandingsTable.vue b/src/components/StandingsTable.vue
index a55ef88..ab7d52f 100644
--- a/src/components/StandingsTable.vue
+++ b/src/components/StandingsTable.vue
@@ -12,12 +12,11 @@
-
+
|
- {{
- team.teamName }}
+ {{ team.teamName }}
|
{{ record(team) }} |
@@ -48,6 +47,16 @@ export default {
required: true
}
},
+ computed: {
+ sortedTeams(): TeamStanding[] {
+ if (!this.teams) return []
+ return this.teams.slice()
+ .sort((t1, t2) =>
+ (t2.wins - t2.losses) !== (t1.wins - t1.losses)
+ ? (t2.wins - t2.losses) - (t1.wins - t1.losses)
+ : (t2.wins + t2.losses) - (t1.wins + t1.losses))
+ }
+ },
methods: {
eliminationNumber(teamStanding: TeamStanding): string {
return this.isDivisional ? teamStanding.divisionEliminationNumber : teamStanding.wildcardEliminationNumber