diff --git a/src/App.vue b/src/App.vue index 343aca2..5c12326 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@
- +
@@ -23,13 +23,43 @@ export default { window: {} } }, + created() { + const { type, window } = this.$route.params + if (type) this.type = type + if (window) this.window = window + }, methods: { setType(type) { this.type = type + this.updateRoute() }, setWindow(window) { this.window = window + this.updateRoute() + }, + updateRoute() { + this.$router.push({ + name: 'view', + params: { + type: this.type, + window: this.window.label ? this.window.label.replace(' ', '-') : undefined + } + }) } } } + diff --git a/src/components/Chart.vue b/src/components/Chart.vue index dc95fc4..87720c9 100644 --- a/src/components/Chart.vue +++ b/src/components/Chart.vue @@ -1,9 +1,10 @@