diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2018-05-21 15:55:52 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2018-12-13 16:59:35 +0100 |
| commit | ec8b0c51f872d2972a3deb6d6a836b9d9fd30141 (patch) | |
| tree | 516e9817b3eedd44540d1283a3443022c3153417 /src/Home.vue | |
| parent | 65d101fadd83c0b22e2285dc4e9825962c29cca0 (diff) | |
| download | brokentalents-ec8b0c51f872d2972a3deb6d6a836b9d9fd30141.tar.gz brokentalents-ec8b0c51f872d2972a3deb6d6a836b9d9fd30141.zip | |
Move query get/set into mixin
Diffstat (limited to 'src/Home.vue')
| -rw-r--r-- | src/Home.vue | 7 |
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; }, }, }, |
