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

[v8] TypeScript error when extending setup helper #499

Closed
Mikilll94 opened this issue Dec 21, 2020 · 4 comments
Closed

[v8] TypeScript error when extending setup helper #499

Mikilll94 opened this issue Dec 21, 2020 · 4 comments

Comments

@Mikilll94
Copy link

I have the following component:

<template>
  <div>{{ text }}</div>
</template>

<script lang="ts">
import { ref } from "vue";
import { Vue, setup, mixins } from "vue-class-component";

const Super = setup(() => {
  const text = ref('A')

  return {
    text,
  }
})

export default class HelloWorld extends mixins(Super) {
}
</script>

It throws TypeScript error:

Screenshot 2020-12-21 at 20 28 51

Here is the repro project:
class-component-test.zip

@ktsn
Copy link
Member

ktsn commented Dec 22, 2020

setup doesn't generate constructor but you should use it for class properties.

@ktsn ktsn closed this as completed Dec 22, 2020
@Mikilll94
Copy link
Author

@ktsn
This is taken from your post:

#416 (comment)

Screenshot 2020-12-22 at 12 15 38

@ktsn
Copy link
Member

ktsn commented Dec 22, 2020

It's "alternative approach" ...

@diphuaji
Copy link

It's "alternative approach" ...

So are you saying it's not implemented yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants