This commit is contained in:
2025-10-31 19:10:01 +07:00
commit e54eb70c86
50 changed files with 11579 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { useRouter } from 'vue-router';
import { ref } from 'vue';
export const useGoBackOrHome = () => {
const router = useRouter();
const canGoBack = ref(false);
if (typeof window !== 'undefined') {
canGoBack.value = window.history.length > 1;
}
const goBack = () => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
canGoBack.value && window.history.length > 1
? router.back()
: router.push('/');
};
return { goBack, canGoBack };
};