Poprawki kodu. Dodano interaktywność rozkładów jazdy.

This commit is contained in:
2020-09-06 21:55:55 +02:00
parent 33b3837bd8
commit 5adb990361
11 changed files with 236 additions and 61 deletions
+12 -1
View File
@@ -19,7 +19,7 @@
</template>
<script lang="ts">
import { Component, Vue, Watch } from "vue-property-decorator";
import { Component, Vue, Watch, Prop } from "vue-property-decorator";
@Component
export default class extends Vue {
@@ -27,6 +27,9 @@ export default class extends Vue {
searchedTrain = "";
searchedDriver = "";
@Prop() readonly passedSearchedTrain!: string;
// @Prop() readonly passedSearchedDriver!: string;
@Watch("searchedTrain")
onSearchedTrainChanged(val: string, oldVal: string) {
this.$emit("changeSearchedTrain", val);
@@ -36,6 +39,14 @@ export default class extends Vue {
onSearchedDriverChanged(val: string, oldVal: string) {
this.$emit("changeSearchedDriver", val);
}
@Watch("passedSearchedTrain")
onPassedSearchedTrainChanged(val: string, oldVal: string) {
if (val && val != "") {
this.searchedTrain = val;
this.searchedDriver = "";
}
}
}
</script>