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(types): support this type with inject option api #6804

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

rudyxu1102
Copy link
Contributor

@rudyxu1102 rudyxu1102 commented Oct 2, 2022

When using inject option api, I can't get foo in this type.

 defineComponent({
    props: ['a'],
    inject: {
      foo: 'foo'
    },
    created() {
      //  ts throw error:Property 'foo' does not exist 
      console.log(this.foo)
    }
  })

I create a PR that inferring this.foo as a unknown. Maybe can fix issues below.

close #5931
close #3031
link #5216

@yyx990803 yyx990803 merged commit e4de623 into vuejs:main Nov 8, 2022
@yyx990803
Copy link
Member

Good job!

@rudyxu1102 rudyxu1102 deleted the fix/inject_type branch November 9, 2022 06:28
chrislone pushed a commit to chrislone/core that referenced this pull request Feb 4, 2023
zhangzhonghe pushed a commit to zhangzhonghe/core that referenced this pull request Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants