b26ec6cc43
cambiato il processo di caricamento in modo da avere la lingua inglese di default come primo avvio
67 lines
1.5 KiB
JavaScript
67 lines
1.5 KiB
JavaScript
import Vue from "vue";
|
|
import VueRouter from "vue-router";
|
|
import VeeValidate from "vee-validate";
|
|
import "./_base/gestures";
|
|
import "./app.modules";
|
|
|
|
import { store, machineStatusActions } from "./store";
|
|
|
|
const App = () =>
|
|
import ("./App.vue");
|
|
|
|
import { routes } from "./app.routes.js";
|
|
|
|
|
|
Vue.use(VueRouter);
|
|
Vue.use(VeeValidate); // forms validation for vuejs
|
|
// Vue.use(VueGesture);
|
|
|
|
let router = new VueRouter({ linkActiveClass: "inpath", linkExactActiveClass: "active" });
|
|
router.addRoutes(routes);
|
|
|
|
// manipulate the title page
|
|
router.beforeEach((to, from, next) => {
|
|
if (to.meta && to.meta.area) {
|
|
// Check if area is enabled
|
|
if (!machineStatusActions.isAreaEnabled(store, to.meta.area)) {
|
|
next({
|
|
path: '/'
|
|
})
|
|
}
|
|
}
|
|
if (to.meta && to.meta.title) {
|
|
window.document.title = to.meta.title;
|
|
}
|
|
next();
|
|
});
|
|
|
|
|
|
// Initialize default language
|
|
import { LocalizationService } from "src/services/localizationService";
|
|
new LocalizationService().init();
|
|
|
|
|
|
let v = new Vue({
|
|
router: router,
|
|
store,
|
|
el: "app",
|
|
render: (h) => h(App),
|
|
});
|
|
|
|
|
|
// Global filters
|
|
import "./filters/searchFilter";
|
|
import "./filters/localizeFilter";
|
|
|
|
// polyfills !!
|
|
|
|
if (!String.prototype.format) {
|
|
String.prototype.format = function() {
|
|
var args = arguments;
|
|
return this.replace(/{(\d+)}/g, function(match, number) {
|
|
return typeof args[number] != 'undefined' ?
|
|
args[number] :
|
|
match;
|
|
});
|
|
};
|
|
} |