summaryrefslogtreecommitdiff
path: root/src/Home.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/Home.vue')
-rw-r--r--src/Home.vue7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Home.vue b/src/Home.vue
index 69de621..b18a3d3 100644
--- a/src/Home.vue
+++ b/src/Home.vue
@@ -11,10 +11,12 @@
<script>
import Vue from 'vue';
import ModeTab from './ModeTab.vue';
+import RouterParamMixin from './RouterParamMixin.js';
import * as maps from './maps/maps';
export default Vue.component('home', {
props: [ 'reportService' ],
+ mixins: [ RouterParamMixin ],
data: function() {
return {
modes: this.reportService.getModes(),
@@ -24,12 +26,11 @@ export default Vue.component('home', {
computed: {
tabIndex: {
get: function() {
- return this.reportService.getModes().indexOf(this.$route.query.mode);
+ return this.reportService.getModes().indexOf(this.selectedMode);
},
set: function(index) {
const mode = this.reportService.getModes()[index];
- const query = Object.assign({}, this.$route.query, { mode: mode });
- this.$router.push({ query });
+ this.selectedMode = mode;
},
},
},