You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coming back to vue after a long time in the react world, I setup a basic app with typescript and I found that vue/typescript ignores missing components from the <template>. Or more specifically does not detect unresolved components in the <template>.
For example take the file below...
<scriptsetuplang="ts">import{RouterLink,RouterView}from'vue-router'// import HelloWorld from './components/HelloWorld.vue'</script><template><header><imgalt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" /><divclass="wrapper"><HelloWorldmsg="You did it!" /><nav><RouterLinkto="/">Home</RouterLink><RouterLinkto="/about">About</RouterLink></nav></div></header><RouterView/></template>
The HelloWorld component is used in the template but I commented out the import in the script. But VSCode shows no type error for the missing component, nor does vite complain during compilation. The app renders fine but the missing component is just rendered as a generic HTML element.
If I replace the import, I get full prop type checking.
What does the proposed solution look like?
I would like a new option in vueCompilerOptions to enforce PascalCase components in the <template> to be resolved.
What problem does this feature solve?
Coming back to vue after a long time in the react world, I setup a basic app with typescript and I found that vue/typescript ignores missing components from the
<template>
. Or more specifically does not detect unresolved components in the<template>
.For example take the file below...
The
HelloWorld
component is used in thetemplate
but I commented out the import in thescript
. But VSCode shows no type error for the missing component, nor does vite complain during compilation. The app renders fine but the missing component is just rendered as a generic HTML element.If I replace the import, I get full prop type checking.
What does the proposed solution look like?
I would like a new option in
vueCompilerOptions
to enforce PascalCase components in the<template>
to be resolved.See original discussion here #3479
The text was updated successfully, but these errors were encountered: