main.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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: "/convert",
  27. component: () => import("./vue/pages/ConvertAccounts.vue")
  28. },
  29. {
  30. path: "/convert/:accountId",
  31. component: () => import("./vue/pages/ConvertAccount.vue")
  32. },
  33. {
  34. path: "/convert/view/:schemaId",
  35. component: () => import("./vue/pages/ViewConvertSchema.vue")
  36. },
  37. {
  38. path: "/options",
  39. component: () => import("./vue/pages/Options.vue")
  40. },
  41. {
  42. path: "/schemas/:schemaId",
  43. component: () => import("./vue/pages/ViewAccountSchema.vue")
  44. },
  45. {
  46. path: "/accounts/add",
  47. component: () => import("./vue/pages/AddAccount.vue")
  48. },
  49. {
  50. path: "/accounts/edit/:accountId",
  51. component: () => import("./vue/pages/EditAccount.vue")
  52. },
  53. ]
  54. });
  55. // router.beforeEach((to, from, next) => {
  56. // next();
  57. // });
  58. lofig.folder = "/config/default.json";
  59. lofig.get("backendUrl").then(url => {
  60. io.init(url);
  61. });
  62. new Vue({
  63. router,
  64. el: "#root",
  65. render: wrapper => wrapper(App)
  66. });