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(runtime-core): components options should accept components define… #602

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

cexbrayat
Copy link
Member

…d with defineComponent

Currently, when using TypeScript, a component defined with defineComponent can not be used in the components options:

const comp = defineComponent({})
defineComponent({
  components: { comp }
})

This example was throwing with:

The last overload gave the following error.
    Type { comp: new () => ComponentPublicInstance<unknown, unknown, unknown, {}, {}, VNodeProps>; } is not assignable to type Record<string, Component>.
      Property comp is incompatible with index signature.

This commit fixes the issue, and adds a simple repro in the dts tests.

…d with defineComponent

Currently, when using TypeScript, a component defined with `defineComponent` can not be used in the `components` options:

```typescript
const comp = defineComponent({})
defineComponent({
  components: { comp }
})
```

This example was throwing with:

```
The last overload gave the following error.
    Type { comp: new () => ComponentPublicInstance<unknown, unknown, unknown, {}, {}, VNodeProps>; } is not assignable to type Record<string, Component>.
      Property comp is incompatible with index signature.
```

This commit fixes the issue, and adds a simple repro in the dts tests.
@yyx990803 yyx990803 merged commit 74baea1 into vuejs:master Jan 13, 2020
@yyx990803
Copy link
Member

Thanks!

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