[+] Sync search settings as a param

This commit is contained in:
Hykilpikonna
2020-04-20 13:22:54 -04:00
parent c0d23770b5
commit 3691f16d8c
3 changed files with 6 additions and 9 deletions
@@ -20,6 +20,7 @@ export default class CourseSelection extends Vue
cardsHeight: number = 0;
openedPage: string = '';
settings: SearchSettings = new SearchSettings();
/**
* Called before rendering
@@ -120,11 +121,6 @@ export default class CourseSelection extends Vue
this.openedPage = this.openedPage == 'settings' ? '' : 'settings';
}
get settings(): SearchSettings
{
return <SearchSettings> this.$refs['settings'];
}
get filteredCourses()
{
let year = GPAUtils.getSchoolYear();
@@ -16,7 +16,7 @@
<el-row>
<el-col :span="16" class="overall-span">
<el-card class="left" :style="{height: cardsHeight + 'px'}">
<SearchSettings ref="settings" v-if="openedPage == 'settings'"></SearchSettings>
<SearchSettings ref="settings" :settings="settings" v-if="openedPage === 'settings'"></SearchSettings>
</el-card>
</el-col>
@@ -3,18 +3,19 @@
<div class="header">Settings</div>
<el-divider class="divider"><i class="el-icon-s-tools"></i></el-divider>
<div class="content">
<el-switch v-model="showAllCourses" active-text="Show all courses (including the ones you can't take next year)"/>
<el-switch v-model="settings.showAllCourses" active-text="Show all courses (including the ones you can't take next year)"/>
</div>
</div>
</template>
<script lang="ts">
import {Component, Vue} from 'vue-property-decorator'
import {Component, Prop, Vue} from 'vue-property-decorator'
@Component
export default class SearchSettingsComponent extends Vue
{
showAllCourses = false;
@Prop({required: true}) settings: SearchSettings;
// TODO: Show all courses option
}
export class SearchSettings