mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-16 11:05:03 +00:00
Initial port to vue 3
This commit is contained in:
parent
e1966534d5
commit
454981fa1f
14 changed files with 1906 additions and 1804 deletions
|
@ -1,14 +1,11 @@
|
|||
import Vue from "vue";
|
||||
import VueRouter from "vue-router";
|
||||
import { createRouter, createWebHistory } from "vue-router";
|
||||
import { authGuard, authRedirectGuard, loginCallbackGuard } from "./auth";
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
export const router = new VueRouter({
|
||||
mode: "history",
|
||||
export const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: [
|
||||
{ path: "/login", beforeEnter: authRedirectGuard },
|
||||
{ path: "/login-callback", beforeEnter: loginCallbackGuard },
|
||||
{ path: "/login", components: {}, beforeEnter: authRedirectGuard },
|
||||
{ path: "/login-callback", component: {}, beforeEnter: loginCallbackGuard },
|
||||
|
||||
// Privacy policy
|
||||
{
|
||||
|
@ -97,12 +94,12 @@ export const router = new VueRouter({
|
|||
scrollBehavior(to, from, savedPosition) {
|
||||
if (to.hash) {
|
||||
return {
|
||||
selector: to.hash,
|
||||
el: to.hash,
|
||||
};
|
||||
} else if (savedPosition) {
|
||||
return savedPosition;
|
||||
} else {
|
||||
return { x: 0, y: 0 };
|
||||
return { left: 0, top: 0 };
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue