Skip to content

Commit

Permalink
fix(compat): respect v-model in vue 2 with compat build (#1565)
Browse files Browse the repository at this point in the history
* fix(compat): respect v-model in vue 2 with compat build

* change ts-ignore
  • Loading branch information
snoozbuster authored Jun 6, 2022
1 parent 6e14c13 commit 3cc95f9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,16 @@ export const createStub = ({
const anonName = 'anonymous-stub'
const tag = name ? `${hyphenate(name)}-stub` : anonName

const propsDeclaration = type
? unwrapLegacyVueExtendComponent(type).props || {}
const componentOptions = type
? unwrapLegacyVueExtendComponent(type) || {}
: {}

return defineComponent({
name: name || anonName,
props: propsDeclaration,
props: componentOptions.props || {},
// fix #1550 - respect old-style v-model for shallow mounted components with @vue/compat
// @ts-expect-error
model: componentOptions.model,
setup(props, { slots }) {
return () => {
// https://github.com/vuejs/test-utils/issues/1076
Expand Down

0 comments on commit 3cc95f9

Please sign in to comment.