mirror of
https://git.hmsn.ink/kospo/svcm/dmz.git
synced 2026-03-20 05:43:33 +09:00
15 lines
425 B
TypeScript
15 lines
425 B
TypeScript
import type { InjectionKey } from 'vue'
|
|
import type { SideblockLayoutContext } from './sideblock.types'
|
|
|
|
export const injectionKey = Symbol('sideblock-layout') as InjectionKey<SideblockLayoutContext>
|
|
|
|
export function useSideblockLayoutContext() {
|
|
const context = inject(injectionKey)
|
|
|
|
if (!context) {
|
|
throw new Error('useSideblockLayoutContext() is called outside of <SideblockLayout> tree.')
|
|
}
|
|
|
|
return context
|
|
}
|