Skip to content

Commit

Permalink
fix: make component construct correctly which class extends from Vue (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos authored and eddyerburgh committed May 25, 2018
1 parent c0b2101 commit 3ecce2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flow/vue.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

// Importing these types declares them, so they are available globally

declare type Component = Object // eslint-disable-line no-undef
declare type Component = Object | Function // eslint-disable-line no-undef
declare type VNode = Object // eslint-disable-line no-undef
declare type SlotValue = Component | string | Array<Component> | Array<string>
2 changes: 1 addition & 1 deletion packages/create-instance/create-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function createInstance (

addEventLogger(vue)

const Constructor = vue.extend(component)
const Constructor = (typeof component === 'function' && component.prototype instanceof Vue) ? component : vue.extend(component)

const instanceOptions = { ...options, propsData: { ...options.propsData }}
deleteoptions(instanceOptions)
Expand Down

0 comments on commit 3ecce2e

Please sign in to comment.