Dodano dynamiczne odświeżanie tabeli

This commit is contained in:
2020-07-04 22:32:15 +02:00
parent 28fab8be92
commit ee2b5ddc07
3 changed files with 15 additions and 11 deletions
+12 -7
View File
@@ -41,7 +41,15 @@ export default Vue.extend({
}),
methods: {
...mapActions(["fetchStations"])
...mapActions(["fetchStations"]),
getStationList() {
this.fetchStations()
.then(() => (this.connectionState = 2))
.catch(err => {
this.connectionState = 1;
this.errorMessage = err.message;
});
}
},
data: () => ({
errorMessage: "",
@@ -49,12 +57,9 @@ export default Vue.extend({
}),
mounted() {
this.fetchStations()
.then(() => (this.connectionState = 2))
.catch(err => {
this.connectionState = 1;
this.errorMessage = err.message;
});
this.getStationList();
setInterval(this.getStationList, 5000);
}
});
</script>
-2
View File
@@ -122,8 +122,6 @@ export default Vue.extend({
);
},
focusedStationInfo() {
console.log(this.focusedStationName);
return this.stations.find(
(station: any) => station.stationName === this.focusedStationName
);