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: make component construct correctly which class extends from Vue #654

Merged
merged 1 commit into from
May 25, 2018

Conversation

kuitos
Copy link
Contributor

@kuitos kuitos commented May 25, 2018

from mount typings we can pass a VueClass type component:

export declare function mount<V extends Vue> (component: VueClass<V>, options?: ThisTypedMountOptions<V>): Wrapper<V>

consider such a scenario

class Component extends Vue {
    $mount() {
        // do something
    }
}
mount(Component)

or a more simple one:

const Component = Vue.extend()
Component.prototype.$mount = function() { /* do something */}
mount(Component)

The Component prototype will be replaced if we extend the passed component directly.

const Constructor = vue.extend(component)

Copy link
Member

@eddyerburgh eddyerburgh left a comment

Choose a reason for hiding this comment

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

Thanks

@eddyerburgh eddyerburgh merged commit 3ecce2e into vuejs:dev May 25, 2018
@kuitos
Copy link
Contributor Author

kuitos commented May 25, 2018

wow so fast!👍
btw, any plans about the next releasing? I am working on a repo which depends on this feature... sorry to rush you😂

@eddyerburgh
Copy link
Member

Around a week 👍

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.

2 participants