core icon indicating copy to clipboard operation
core copied to clipboard

fix(types): support this type with `inject` option api

Open rudyxu1102 opened this issue 3 years ago • 0 comments

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 infering this.foo as a unkown. Maybe can fix issues below.

close #5931 close #3031 link #5216

rudyxu1102 avatar Oct 02 '22 04:10 rudyxu1102