fix(types): fix error with options watch (#12779)

fix #12780
This commit is contained in:
fukang wang 2022-10-11 14:43:33 +08:00 committed by GitHub
parent fb13930096
commit bc5b92adde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

2
types/options.d.ts vendored
View File

@ -181,7 +181,7 @@ export interface ComponentOptions<
propsData?: object
computed?: Accessors<Computed>
methods?: Methods
watch?: Record<string, WatchOptionsWithHandler<any> | WatchHandler<any>>
watch?: Record<string, WatchOptionsWithHandler<any> | WatchHandler<any> | Array<WatchOptionsWithHandler<any> | WatchHandler<any>>>
setup?: (
this: void,

View File

@ -172,7 +172,14 @@ Vue.component('component', {
d: {
handler: 'someMethod',
immediate: true
}
},
e: [
'handle1',
function handle2 (val, oldVal) {},
{
handler: function handle3 (val, oldVal) {},
}
],
},
el: '#app',
template: '<div>{{ message }}</div>',