From b18ac8b055af1def5f52fc25950d9a14a58212cc Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Fri, 11 May 2018 21:04:42 +0200
Subject: sync tab selection with URL

---
 src/Home.vue | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 src/Home.vue

(limited to 'src/Home.vue')

diff --git a/src/Home.vue b/src/Home.vue
new file mode 100644
index 0000000..c0fef32
--- /dev/null
+++ b/src/Home.vue
@@ -0,0 +1,41 @@
+<template>
+    <b-tabs v-model="tabIndex">
+      <b-tab-item label="Blitz">
+        <blitz-tab :reportService="reportService"></blitz-tab>
+      </b-tab-item>
+
+      <b-tab-item label="Battle Royale">
+        <battle-royale-tab :reportService="reportService"></battle-royale-tab>
+      </b-tab-item>
+    </b-tabs>
+  </div>
+</template>
+
+<script>
+import Vue from 'vue';
+import BlitzTab from './BlitzTab.vue';
+import BattleRoyaleTab from './BattleRoyaleTab.vue';
+import ReportService from './report-service.js';
+
+export default Vue.component('home', {
+  props: [ 'reportService' ],
+  data: function() {
+    return {
+    };
+  },
+  computed: {
+    tabIndex: {
+      get: function() {
+        return this.$route.query.tab;
+      },
+      set: function(value) {
+        this.$router.push({ query: { tab: value }});
+      },
+    },
+  },
+  components: {
+    BlitzTab,
+    BattleRoyaleTab,
+  },
+});
+</script>
-- 
cgit v1.3.1

