-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
global typescript interface cannot be used by defineProps #8612
Comments
You can only use the current file's type or interface at present. |
I dont follow,
|
As to why common variables you can use the namespace without importing, defineProps type will be used when compiling, common variables's type didn't, vscode can deal with that. |
@Neverflow vue({
script: {
globalTypeFiles: [
'./src/types/index.d.ts'
]
}
}) and //src/types/index.d.ts
declare interface Test {
name: string;
} |
oh, thanks |
Oh great well somehow missed that completely, only annoying thing is that it's still missing from the typescript declarations. Ty for the help |
Vue version
3.3.4
Link to minimal reproduction
https://github.com/Disservin/vue-ts-error/tree/unresolvable-type/vue-ts-error
Steps to reproduce
Clone the repository and cd into
vue-ts-error
What is expected?
The build should finish normal and throw no errors.
What is actually happening?
The
Test
interface cannot be unused fordefineProps
. You will getThe current workaround is to explictly import the type and export the interface
VTest.vue
index.d.ts
System Info
No response
Any additional comments?
direct link to the component
direct link to the index
The text was updated successfully, but these errors were encountered: