main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import Vue from "vue";
  2. import VueRouter from "vue-router";
  3. import App from "./vue/App.vue";
  4. import io from "./io.js";
  5. Vue.use(VueRouter);
  6. const router = new VueRouter({
  7. mode: "history",
  8. routes: [
  9. {
  10. path: "/",
  11. component: () => import("./vue/pages/Homepage.vue")
  12. },
  13. {
  14. path: "*",
  15. component: () => import("./vue/pages/NotFound.vue")
  16. },
  17. {
  18. path: "/accounts",
  19. component: () => import("./vue/pages/Accounts.vue")
  20. },
  21. {
  22. path: "/schemas",
  23. component: () => import("./vue/pages/Schemas.vue")
  24. },
  25. {
  26. path: "/options",
  27. component: () => import("./vue/pages/Options.vue")
  28. },
  29. {
  30. path: "/schemas/:schemaId",
  31. component: () => import("./vue/pages/ViewSchema.vue")
  32. },
  33. {
  34. path: "/accounts/add",
  35. component: () => import("./vue/pages/AddAccount.vue")
  36. },
  37. {
  38. path: "/accounts/edit/:accountId",
  39. component: () => import("./vue/pages/EditAccount.vue")
  40. },
  41. ]
  42. });
  43. // router.beforeEach((to, from, next) => {
  44. // next();
  45. // });
  46. lofig.folder = "/config/default.json";
  47. lofig.get("backendUrl").then(url => {
  48. io.init(url);
  49. });
  50. new Vue({
  51. router,
  52. el: "#root",
  53. render: wrapper => wrapper(App)
  54. });