summaryrefslogtreecommitdiff
path: root/src/RouterParamMixin.js
blob: 6172d55cbe670b4e90fa6ac6f850c45cf55c0c99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export default {
  computed: {
    selectedActor: {
      get: function() {
        return this.$route.query.actor || '*Kensei*';
      },
      set: function(value) {
        this.$ga.event('Hero', 'update', value);
        const query = Object.assign({}, this.$route.query, { actor: value });
        this.$router.push({ query });
      },
    },
    selectedMode: {
      get: function() {
        return this.$route.query.mode || 'blitz_pvp_ranked';
      },
      set: function(value) {
        this.$ga.event('Mode', 'update', value);
        const query = Object.assign({}, this.$route.query, { mode: value });
        this.$router.push({ query });
      },
    },
  },
};