main.js 1.3 KB

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