From dbca57d7e11bd13e4b400c3f25d5652069fdc95f Mon Sep 17 00:00:00 2001 From: Marco Crapts Date: Mon, 1 Jul 2019 20:58:02 +0200 Subject: [PATCH] update --- src/App.vue | 32 ++++++++++++++++- src/components/Chart.vue | 66 ++++++++++++++++++++++++++-------- src/components/Loader.vue | 4 +-- src/components/NavBar.vue | 2 +- src/components/TimeWindows.vue | 11 ++++-- src/style/_variables.scss | 4 +++ src/style/style.scss | 4 +++ 7 files changed, 102 insertions(+), 21 deletions(-) create mode 100644 src/style/_variables.scss 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 @@