Skip to content

Commit 3ecce2e

Browse files
kuitoseddyerburgh
authored andcommitted
fix: make component construct correctly which class extends from Vue (#654)
1 parent c0b2101 commit 3ecce2e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: flow/vue.flow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

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

5-
declare type Component = Object // eslint-disable-line no-undef
5+
declare type Component = Object | Function // eslint-disable-line no-undef
66
declare type VNode = Object // eslint-disable-line no-undef
77
declare type SlotValue = Component | string | Array<Component> | Array<string>

Diff for: packages/create-instance/create-instance.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function createInstance (
5555

5656
addEventLogger(vue)
5757

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

6060
const instanceOptions = { ...options, propsData: { ...options.propsData }}
6161
deleteoptions(instanceOptions)

0 commit comments

Comments
 (0)