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

$event regression in v0.25.25 #287

Closed
cexbrayat opened this issue Jul 2, 2021 · 2 comments
Closed

$event regression in v0.25.25 #287

cexbrayat opened this issue Jul 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@cexbrayat
Copy link
Member

It looks like 8628f3f introduced a regression in our projects.

We're using vee-validate, which offers a Form component, with a submit event. You can listen to this submit event to call a method of the component with the submitted values.

With volar v0.25.25, using a simple component like:

<template>
  <Form @submit="register($event)">
    <Field name="login"></Field>
  </Form>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { Field, Form } from 'vee-validate';

export default defineComponent({
  name: 'App',
  components: {
    Form,
    Field
  },
  setup() {
    return {
      register(user: { login: string }) {
        console.log(user)
      }
    }
  }
});
</script>

Makes vue-tsc throw:

src/App.vue:2:27 - error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{ login: string; }'.

2   <Form @submit="register($event)">

I put together a small repro here: cexbrayat/vue-v313#1

@johnsoncodehk
Copy link
Member

Thanks for the repro case! Fixed in b0d6afc.

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Jul 2, 2021
@cexbrayat
Copy link
Member Author

@johnsoncodehk Awesome, thanks! I manually patched my vscode-vue-languageservice package with your fix and I confirm it fixes the issue in our project 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants