Skip to content

Commit

Permalink
fix: 修复providerkey类型
Browse files Browse the repository at this point in the history
  • Loading branch information
agileago committed Dec 14, 2021
1 parent 1ac0ad0 commit 0d0ed40
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"vitepress": "^0.20.1",
"vue": "^3.2.20",
"vue-router": "^4.0.12",
"yorkie": "^2.0.0"
"yorkie-pnpm": "^2.0.1"
},
"gitHooks": {
"pre-commit": "lint-staged",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/extends/component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentPublicInstance, getCurrentInstance, provide, VNodeChild, VNodeProps } from 'vue'
import { ComponentPublicInstance, getCurrentInstance, InjectionKey, provide, VNodeChild, VNodeProps } from 'vue'
import { getEmitsFromProps, useCtx, useProps } from '../helper'
import { Hanlder, VueComponentStaticContructor, WithSlotTypes, WithVModel, WithVSlots } from '../type'
import { RefHandler } from '../decorators/ref'
Expand Down Expand Up @@ -49,7 +49,7 @@ export abstract class VueComponent<T extends {} = {}> {
/** 是否作为全局store提供外部入口,此时会在 当前app上注入2个方法,用于获取此组件的服务 */
static globalStore?: boolean
/** 是否把自己当做服务provide出去,以便子组件可注入 */
static ProviderKey?: string | symbol
static ProviderKey?: string | symbol | number | InjectionKey<any>
/** 主要给jsx提示用 */
get $props() {
return this.props
Expand Down
4 changes: 2 additions & 2 deletions src/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Prop, SetupContext, VNodeChild } from 'vue'
import { InjectionKey, Prop, SetupContext, VNodeChild } from 'vue'

export interface VueComponentStaticContructor {
new (...args: any[]): any
Expand All @@ -11,7 +11,7 @@ export interface VueComponentStaticContructor {
/** 组件使用的指令 */
directives?: any
/** 组件作为服务的key */
ProviderKey?: symbol | string
ProviderKey?: symbol | string | number | InjectionKey<any>
/** 组件是否作为全局服务 */
globalStore?: boolean
/** 自定义解析组件 */
Expand Down

0 comments on commit 0d0ed40

Please sign in to comment.