From ec8b0c51f872d2972a3deb6d6a836b9d9fd30141 Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Mon, 21 May 2018 15:55:52 +0200
Subject: Move query get/set into mixin

---
 src/HeroTalentTable.vue | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

(limited to 'src/HeroTalentTable.vue')

diff --git a/src/HeroTalentTable.vue b/src/HeroTalentTable.vue
index 881d441..fee687e 100644
--- a/src/HeroTalentTable.vue
+++ b/src/HeroTalentTable.vue
@@ -29,22 +29,21 @@
 import Vue from 'vue';
 import TalentImage from './TalentImage.vue';
 import HeroImage from './HeroImage.vue';
+import RouterParamMixin from './RouterParamMixin.js';
 import * as maps from './maps/maps';
 
 export default Vue.component('hero-talent-table', {
   props: [ 'reportService' ],
+  mixins: [ RouterParamMixin ],
   data: function() {
     return {
-      totalPicks: this.reportService.getTotalPicks('casual_aral'),
       getHero: maps.getHero,
       getTalentName: maps.getTalentName,
     };
   },
   computed: {
-    selectedMode: {
-      get: function() {
-        return this.$route.query.mode;
-      },
+    totalPicks: function() {
+      return this.reportService.getTotalPicks(this.selectedMode);
     },
     heroReport: function() {
       return this.reportService.getReport(this.selectedMode)
@@ -55,11 +54,6 @@ export default Vue.component('hero-talent-table', {
         .map((entry) => entry.Count)
         .reduce((agg, cur) => agg + cur, 0);
     },
-    selectedActor: {
-      get: function() {
-        return this.$route.query.actor;
-      },
-    },
   },
   components: {
     TalentImage,
-- 
cgit v1.3.1

