Skip to content

Strange errors in vue-class-component v8 #457

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

Closed
Mikilll94 opened this issue Sep 20, 2020 · 2 comments
Closed

Strange errors in vue-class-component v8 #457

Mikilll94 opened this issue Sep 20, 2020 · 2 comments
Labels

Comments

@Mikilll94
Copy link

I have a class component like this:

import Person from '@/models/Person';
import { PropType } from 'vue';
import { emits, mixins, Options, props } from 'vue-class-component';

const Props = props({
  person: {
    type: Object as PropType<Person>,
    required: true
  }
})

const Emits = emits({
  input: (value) => typeof value === 'number'
})

@Options
export default class HelloWorld extends mixins(Props, Emits) {
  private myData = this.person;

  mounted() {
    this.$emit('input', 2);
  }
}

And I receive the following errors:

Screenshot 2020-09-20 at 12 33 07

Here is the repro project which you can run and check this error:
class-component-test.zip

I am using:

  • vue 3.0.0
  • vue-class-component 8.0.0-beta.3
@ktsn ktsn added the bug label Sep 20, 2020
@ktsn
Copy link
Member

ktsn commented Sep 20, 2020

Thanks for reporting this. This is caused by the wrong type definition of @Options. Will fix it in the next version.

@ktsn
Copy link
Member

ktsn commented Oct 4, 2020

fixed in beta.4

@ktsn ktsn closed this as completed Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants