router.ts 560 B

1234567891011121314151617181920
  1. import { createRouter, createWebHashHistory } from "vue-router";
  2. import Overview from "./views/overview/index.vue";
  3. import Tabulation from "./views/tabulation/index.vue";
  4. export const history = createWebHashHistory();
  5. const routes = [{ path: "/overview", name: "overview", component: Overview }];
  6. if (!window.platform.sceneDraw) {
  7. routes.push({ path: "/tabulation", name: "tabulation", component: Tabulation })
  8. }
  9. export const router = createRouter({
  10. history,
  11. routes: [
  12. ...routes,
  13. { path: "/:pathMatch(.*)*", redirect: "/overview" },
  14. ],
  15. });