@bitrix24/b24ui-nuxt
Version:
Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE
17 lines (16 loc) • 485 B
JavaScript
import {
inject,
getCurrentInstance
} from "vue";
export const sidebarLayoutInjectionKey = Symbol("bitrix24-ui.sidebar-layout");
export function useSidebarLayout() {
const instance = getCurrentInstance();
if (!instance) {
throw new Error("useSidebarLayout must be called within a component");
}
const context = inject(sidebarLayoutInjectionKey, null);
if (!context) {
throw new Error("useSidebarLayout must be used within SidebarLayout");
}
return context;
}