mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 05:18:10 +00:00
Kopiowanie składu do schowka; możliwość losowania wagonów pasażerskich
This commit is contained in:
+18
-2
@@ -1,10 +1,25 @@
|
||||
import { createApp } from "vue";
|
||||
import { createApp, Directive } from "vue";
|
||||
import App from "./App.vue";
|
||||
|
||||
import { Store, locoDataList, carDataList, totalLength, totalMass, maxAllowedSpeed, maxStockSpeed, isTrainPassenger, warnings } from "./store";
|
||||
import { Store, isLocomotive, locoDataList, carDataList, totalLength, totalMass, maxAllowedSpeed, maxStockSpeed, isTrainPassenger, warnings } from "./store";
|
||||
|
||||
const clickOutsideDirective: Directive = {
|
||||
beforeMount(el, binding) {
|
||||
|
||||
el.clickOutsideEvent = (event: Event) => {
|
||||
if (!(el == event.target || el.contains(event.target))) {
|
||||
binding.value();
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener("click", el.clickOutsideEvent);
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
createApp(App)
|
||||
.provide('Store', Store)
|
||||
.provide('isLocomotive', isLocomotive)
|
||||
.provide('locoDataList', locoDataList)
|
||||
.provide('carDataList', carDataList)
|
||||
.provide('totalMass', totalMass)
|
||||
@@ -13,4 +28,5 @@ createApp(App)
|
||||
.provide('maxAllowedSpeed', maxAllowedSpeed)
|
||||
.provide('isTrainPassenger', isTrainPassenger)
|
||||
.provide('warnings', warnings)
|
||||
.directive('click-outside', clickOutsideDirective)
|
||||
.mount("#app");
|
||||
|
||||
Reference in New Issue
Block a user