Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c3ccae0

Browse filesBrowse files
committed
fix: make decorator accepts any vue constructor types (fix #457)
1 parent d723050 commit c3ccae0
Copy full SHA for c3ccae0

File tree

Expand file treeCollapse file tree

1 file changed

+9
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-5
lines changed

‎src/helpers.ts

Copy file name to clipboardExpand all lines: src/helpers.ts
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919

2020
export function Options<V extends Vue>(
2121
options: ComponentOptions & ThisType<V>
22-
): <VC extends VueConstructor>(target: VC) => VC {
22+
): <VC extends VueConstructor<VueBase>>(target: VC) => VC {
2323
return (Component) => {
2424
Component.__vccBase = options
2525
return Component
@@ -28,19 +28,23 @@ export function Options<V extends Vue>(
2828

2929
export interface VueDecorator {
3030
// Class decorator
31-
(Ctor: VueConstructor): void
31+
(Ctor: VueConstructor<VueBase>): void
3232

3333
// Property decorator
34-
(target: Vue, key: string): void
34+
(target: VueBase, key: string): void
3535

3636
// Parameter decorator
37-
(target: Vue, key: string, index: number): void
37+
(target: VueBase, key: string, index: number): void
3838
}
3939

4040
export function createDecorator(
4141
factory: (options: ComponentOptions, key: string, index: number) => void
4242
): VueDecorator {
43-
return (target: Vue | VueConstructor, key?: any, index?: any) => {
43+
return (
44+
target: VueBase | VueConstructor<VueBase>,
45+
key?: any,
46+
index?: any
47+
) => {
4448
const Ctor =
4549
typeof target === 'function'
4650
? target

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.