wip: more compat tweaks

This commit is contained in:
Evan You
2021-04-22 09:49:25 -04:00
parent 12abd4af85
commit 98bc9a26e9
5 changed files with 62 additions and 13 deletions

View File

@@ -360,10 +360,11 @@ export type ExtractComputedReturns<T extends any> = {
: T[key] extends (...args: any[]) => infer TReturn ? TReturn : never
}
type WatchOptionItem =
| string
| WatchCallback
| { handler: WatchCallback | string } & WatchOptions
export type ObjectWatchOptionItem = {
handler: WatchCallback | string
} & WatchOptions
type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem
type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[]
@@ -949,7 +950,7 @@ function resolveData(
}
}
function createWatcher(
export function createWatcher(
raw: ComponentWatchOptionItem,
ctx: Data,
publicThis: ComponentPublicInstance,