Browse Source

types: fix setup this type (#605)

Yang Mingshan 6 years ago
parent
commit
f465199946
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/runtime-core/src/apiOptions.ts

+ 2 - 2
packages/runtime-core/src/apiOptions.ts

@@ -51,7 +51,7 @@ export interface ComponentOptionsBase<
   M extends MethodOptions
   M extends MethodOptions
 > extends LegacyOptions<Props, RawBindings, D, C, M>, SFCInternalOptions {
 > extends LegacyOptions<Props, RawBindings, D, C, M>, SFCInternalOptions {
   setup?: (
   setup?: (
-    this: null,
+    this: void,
     props: Props,
     props: Props,
     ctx: SetupContext
     ctx: SetupContext
   ) => RawBindings | RenderFunction | void
   ) => RawBindings | RenderFunction | void
@@ -82,7 +82,7 @@ export type ComponentOptionsWithoutProps<
   D = {},
   D = {},
   C extends ComputedOptions = {},
   C extends ComputedOptions = {},
   M extends MethodOptions = {}
   M extends MethodOptions = {}
-> = ComponentOptionsBase<Props, RawBindings, D, C, M> & {
+> = ComponentOptionsBase<Readonly<Props>, RawBindings, D, C, M> & {
   props?: undefined
   props?: undefined
 } & ThisType<ComponentPublicInstance<{}, RawBindings, D, C, M, Readonly<Props>>>
 } & ThisType<ComponentPublicInstance<{}, RawBindings, D, C, M, Readonly<Props>>>