New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix $createElement and Vue.extend #3818
Conversation
/cc @ktsn |
@@ -39,10 +41,9 @@ export declare class Vue { | |||
$emit(event: string, ...args: any[]): this; | |||
$nextTick(callback?: (this: this) => void): void; | |||
$createElement( | |||
tag?: string | Vue, | |||
tag?: string | Component | (() => string | Component), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the function type of this argument is the factory of async component.
So I think following type is more appropriate.
string |
Component |
((
resolve: (component: Component) => void,
reject: any
) => Promise<Component> | Component | void)
Maybe it would be better to define AsyncComponent
for this function type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -39,10 +41,9 @@ export declare class Vue { | |||
$emit(event: string, ...args: any[]): this; | |||
$nextTick(callback?: (this: this) => void): void; | |||
$createElement( | |||
tag?: string | Vue, | |||
tag?: string | Component | AsyncComponent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly what was breaking things up for me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
According to 06b4703,
namespace
has been removed, so I updated the types.Also, I fixed the first argument of
$createElement
.In addition, add
FunctionalComponentOptions
toVue.extend