woodpecker/web/src/compositions/useRouteBack.ts

10 lines
203 B
TypeScript
Raw Normal View History

import { RouteLocationRaw, useRouter } from 'vue-router';
export function useRouteBack(to: RouteLocationRaw) {
const router = useRouter();
return async () => {
await router.replace(to);
};
}