Skip to content
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

Merged
merged 2 commits into from Sep 30, 2016
Merged

Fix $createElement and Vue.extend #3818

merged 2 commits into from Sep 30, 2016

Conversation

kaorun343
Copy link
Contributor

According to 06b4703, namespace has been removed, so I updated the types.
Also, I fixed the first argument of $createElement.
In addition, add FunctionalComponentOptions to Vue.extend

@yyx990803
Copy link
Member

/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),
Copy link
Member

@ktsn ktsn Sep 30, 2016

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaorun343
Copy link
Contributor Author

I've fixed.

Copy link
Member

@ktsn ktsn left a 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,
Copy link
Contributor

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 👍

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@yyx990803 yyx990803 merged commit ef69459 into vuejs:dev Sep 30, 2016
@kaorun343 kaorun343 deleted the fix-types branch November 2, 2016 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants