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): make $refs undefined possible #11112

Merged
merged 1 commit into from Apr 16, 2021
Merged

fix(types): make $refs undefined possible #11112

merged 1 commit into from Apr 16, 2021

Commits on Feb 17, 2020

  1. Update vue.d.ts

    Added undefined as a return type of $refs as it was quite hard to convince typescript that something COULD be undefined if you type in a ref that doesn't exist,
    I also changed the two array statements from `Element[] | Vue[]` to `(Element | Vue)[]` because it's not guaranteed that they are ALL Elements or they are ALL Vue components. (Very likely, yes, but not always)
    For example
    ```html
    <template v-for="(a, index) of b">
      <div v-if="index % 2 === 0" ref="test"></div>
      <my-component v-else ref="test"></my-component>
    </template>
    ```
    WORMSS committed Feb 17, 2020
    Copy the full SHA
    c16f1c8 View commit details
    Browse the repository at this point in the history