2d855b8a2a284415dc25bd5dbe6b9fb092fed132
[vchess.git] / client / src / main.js
1 import Vue from "vue";
2 import App from "./App.vue";
3 import router from "./router";
4 import { store } from "./store";
5
6 Vue.config.productionTip = false;
7
8 new Vue({
9 router,
10 render: function(h) {
11 return h(App);
12 },
13 created: function() {
14 window.doClick = (elemId) => { document.getElementById(elemId).click() };
15 document.addEventListener("keydown", (e) => {
16 if (e.code === "Escape")
17 {
18 let modalBoxes = document.querySelectorAll("[id^='modal']");
19 modalBoxes.forEach(m => {
20 if (m.checked)
21 m.checked = false;
22 });
23 }
24 });
25 // NOTE: store.initialize(this.$route.path); doesn't work
26 store.initialize(window.location.href.split("#")[1].split("?")[0]);
27 },
28 }).$mount("#app");