Skip to content

Commit f353a34

Browse files
committed
Update ViewDropdown.vue
1 parent 6c44726 commit f353a34

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

components/ui/ViewDropdown.vue

+10-1
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131
class="dropdown-divider"
3232
v-if="view.id === 'divider'">
3333

34+
<!-- range=all-12-mth-rolling&interval=1M&metric=renewablesProportion -->
35+
3436
<nuxt-link
3537
v-else
3638
v-show="shouldShow(view.id)"
37-
:to="`/${view.id}${getRegionId(view.id)}`"
39+
:to="`/${view.id}${getRegionId(view.id)}${appendQuery(view.id)}`"
3840
:class="{ 'nuxt-link-active': view.id === currentView }"
3941
class="dropdown-item"
4042
@click.native="handleViewClick(view.id)"
@@ -80,6 +82,13 @@ export default {
8082
},
8183
8284
methods: {
85+
appendQuery(id) {
86+
console.log(id)
87+
if (id === 'compare') return '?range=all-12-mth-rolling&interval=1M&metric=renewablesProportion'
88+
if (id === 'energy') return '?range=7d&interval=30m&view=discrete-time'
89+
if (id === 'emissions') return '??interval=Year&projections=false&history=false'
90+
return ''
91+
},
8392
handleClick() {
8493
this.dropdownActive = !this.dropdownActive
8594
this.$emit('dropdownActive', this.dropdownActive)

0 commit comments

Comments
 (0)