Kaynağa Gözat

fix(types): accept sync `serverPrefetch()` (#7000)

Anthony Fu 3 yıl önce
ebeveyn
işleme
5f1883ec53
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      packages/runtime-core/src/componentOptions.ts

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

@@ -149,7 +149,7 @@ export interface ComponentOptionsBase<
   emits?: (E | EE[]) & ThisType<void>
   // TODO infer public instance type based on exposed keys
   expose?: string[]
-  serverPrefetch?(): Promise<any>
+  serverPrefetch?(): void | Promise<any>
 
   // Runtime compiler only -----------------------------------------------------
   compilerOptions?: RuntimeCompilerOptions