Skip to content

Commit

Permalink
fix(types): fix error with options watch (#12779)
Browse files Browse the repository at this point in the history
fix #12780
  • Loading branch information
wfk007 committed Oct 11, 2022
1 parent fb13930 commit bc5b92a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 8 additions & 1 deletion types/test/options-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>',
Expand Down

0 comments on commit bc5b92a

Please sign in to comment.