ソースを参照

fix(types): support generic argument in setup context expose method (#8507)

Noel De Martin 1 年間 前
コミット
635a59b96f
1 ファイル変更1 行追加1 行削除
  1. 1 1
      packages/runtime-core/src/component.ts

+ 1 - 1
packages/runtime-core/src/component.ts

@@ -234,7 +234,7 @@ export type SetupContext<
       attrs: Data
       slots: UnwrapSlotsType<S>
       emit: EmitFn<E>
-      expose: (exposed?: Record<string, any>) => void
+      expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void
     }
   : never