mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Poprawki kodu. Dodano interaktywność rozkładów jazdy.
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user