assembly/composables/useBackdrop.ts
Georges KABBOUCHI e22a0cc177 wip
2021-07-26 21:33:52 +03:00

17 lines
367 B
TypeScript

import { computed } from "@nuxtjs/composition-api";
import { useSidebar } from "./useSidebar";
export function useBackdrop() {
const { isOpen: isSidbarOpen, close: closeSidbar } = useSidebar();
const isShown = computed(() => isSidbarOpen.value);
function close() {
if (isSidbarOpen.value) {
closeSidbar();
}
}
return { isShown, close };
}