diff --git a/src/App.vue b/src/App.vue index 4225347..ee5e343 100644 --- a/src/App.vue +++ b/src/App.vue @@ -39,6 +39,8 @@ onMounted(() => { {'name': 'Конец', 'up': true, 'connectedStations': [], 'step': store.width - 400} ] + window.onbeforeunload = () => false + map = new Map(branch, settings); build(); @@ -117,7 +119,7 @@ function build () { connectedStations.push(extraStation); } - let modelStation = new Station(station['name'], station['up'], connectedStations, station['step']) + let modelStation = new Station(station['name'], station['up'], connectedStations, Number(station['step'])) stations.push(modelStation); } @@ -130,6 +132,10 @@ function build () { map.build() } + +store.$subscribe((mutation, state) => { + build(); +})