Skip to content

Type Inference error in template #460

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
Darma1106 opened this issue Sep 7, 2021 · 5 comments
Closed

Type Inference error in template #460

Darma1106 opened this issue Sep 7, 2021 · 5 comments
Labels

Comments

@Darma1106
Copy link

Darma1106 commented Sep 7, 2021

In BaseModel.vue:

interface Props {
  title: string
  width: string
  onOk: () => void
  onClose: () => void
}

const props = withDefaults(defineProps<Props>(), {
  title: 'defaultTitle',
  width: '50%'
})

In other file:
onOK

why 'onOk' will be undefined

@johnsoncodehk
Copy link
Member

Please make and provide a repro case by https://github.com/johnsoncodehk/volar-starter.

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Sep 7, 2021
@johnsoncodehk
Copy link
Member

It seems vue 3.2.0 problem by vuejs/core#3926.

@johnsoncodehk johnsoncodehk added upstream and removed bug Something isn't working labels Sep 7, 2021
@Darma1106
Copy link
Author

It seems vue 3.2.0 problem by vuejs/vue-next#3926.

thank you, I just upgrade my dependencies and solved it.

@jonybekov
Copy link

It's also reproducing when using Nuxt 3 latest

@yotarotsukada
Copy link

The same occurred when I configured TS version as VSCode's version (4.9.0-dev.20220919).

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

4 participants