mirror of
https://git.hmsn.ink/kospo/svcm/dmz.git
synced 2026-03-20 10:43:39 +09:00
first
This commit is contained in:
14
src/components/layouts/sideblock/sideblock.context.ts
Normal file
14
src/components/layouts/sideblock/sideblock.context.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user