Skip to content

Commit 18538df

Browse files
committed
pass starting order from parent
1 parent be30ee1 commit 18538df

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

frontend/src/components/app/recommendations/Recommendations.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<template>
22
<!-- eslint-disable max-len -->
33
<section>
4-
<h1 class="text-5xl my-4 text-center md:text-left leading-none onboarding-sub-container-content-heading">{{recommendations.length}} {{title}}</h1>
4+
<h1
5+
class="text-5xl my-4 text-center md:text-left leading-none onboarding-sub-container-content-heading">
6+
{{recommendations.length}} {{title}}</h1>
57
<div class="flex w-full items-stretch sm:items-center justify-center md:justify-start mb-12 relative">
68
<Sort
79
v-bind:position="'left'"
8-
v-bind:options="['Closest', 'Furthest', 'Youngest', 'Oldest', 'Most popular', 'Least popular', 'Most common interests', 'Least common interests']"
10+
v-bind:startingOption="'Closest'"
11+
v-bind:options="['Closest', 'Furthest', 'Youngest',
12+
'Oldest', 'Most popular', 'Least popular', 'Most common interests', 'Least common interests']"
913
v-on:saveSort="saveSort"></Sort>
1014
<FilterSlider
1115
v-bind:min="recommendationsAnalysis.age.min"

frontend/src/components/shared/Sort.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
<script>
1818
export default {
19-
props: ['options', 'name', 'position'],
19+
props: ['options', 'name', 'position', 'startingOption'],
2020
data: () => ({
2121
closed: true,
22-
currentOption: 'Closest',
22+
currentOption: '',
2323
}),
2424
methods: {
2525
select(option) {
@@ -34,5 +34,8 @@ export default {
3434
this.closed = true;
3535
},
3636
},
37+
beforeMount() {
38+
this.currentOption = this.startingOption;
39+
},
3740
};
3841
</script>

0 commit comments

Comments
 (0)