Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
zmtlwzy committed Oct 22, 2022
1 parent 035dcf0 commit 54311eb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/composables/core/useContextLite.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { InjectionKey } from 'vue'

export default function useContext<T>(contextName = 'context') {
const injectKey: InjectionKey<T> = Symbol(contextName)

function useProvide(context: T) {
provide(injectKey, context)
return context
}

function useInject() {
return inject(injectKey) as T
}

return {
useProvide,
useInject,
}
}
2 changes: 2 additions & 0 deletions types/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ declare module '@vue/runtime-core' {
CountButton: typeof import('./../src/components/CountDown/CountButton.vue')['default']
CountdownInput: typeof import('./../src/components/CountDown/CountdownInput.vue')['default']
CountTo: typeof import('./../src/components/CountTo/CountTo.vue')['default']
DataPopover: typeof import('./../src/components/DataPopover/index.vue')['default']
EditableCell: typeof import('./../src/components/Table/src/components/editable/EditableCell.vue')['default']
IAkarIconsCircleFill: typeof import('~icons/akar-icons/circle-fill')['default']
IAkarIconsMobileDevice: typeof import('~icons/akar-icons/mobile-device')['default']
Expand Down Expand Up @@ -64,6 +65,7 @@ declare module '@vue/runtime-core' {
'IFluent:arrowEnterLeft24Filled': typeof import('~icons/fluent/arrow-enter-left24-filled')['default']
'IFluent:arrowUp24Filled': typeof import('~icons/fluent/arrow-up24-filled')['default']
'IIc:roundSearch': typeof import('~icons/ic/round-search')['default']
'IIc:sharpArrowBackIos': typeof import('~icons/ic/sharp-arrow-back-ios')['default']
IIcBaselineLanguage: typeof import('~icons/ic/baseline-language')['default']
IIconParkOutlineBranchOne: typeof import('~icons/icon-park-outline/branch-one')['default']
IIcTwotoneWork: typeof import('~icons/ic/twotone-work')['default']
Expand Down
4 changes: 4 additions & 0 deletions types/vue-router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ declare module 'vue-router' {
orderNo?: number;
// title
title: string;
// dynamic router level.
dynamicLevel?: number;
// dynamic router real route path (For performance).
realPath?: string;
// Whether to ignore permissions
ignoreAuth?: boolean;
// role info
Expand Down

0 comments on commit 54311eb

Please sign in to comment.