Closed StefanGhiban closed 2 years ago
Can you provide me a minimal reproduction?
@xiaoxiangmoe
Hey there! I'm getting the same issue. I'm using latest Vite/Vue/Typescript, and importing components using the following code:
const componentsPlugin: Plugin = {
install: (app) => {
const components = import.meta.globEager('./*.vue');
for (const key in components) {
const component = components[key].default
app.component(component.name, component);
}
},
};
See https://github.com/antfu/unplugin-vue-components#typescript
Duplicate of #522
@johnsoncodehk The solution from issue #522 doesnt work for me. "editor.semanticHighlighting.enabled": true doesn't change aything for me. Also, the typescript section of the unplugin vue components doesnt apply to me because I am not using typescript.
@StefanGhiban Try setting your config to generate the d.ts file: https://github.com/antfu/unplugin-vue-components#typescript. Even though you're using js you need to do this step.
This doesn't work for me tsconfig.json
{
"include": [
"./components.d.ts"
],
}
Hi! I have disabled vetur to not have any conflicts with volar and the green highlighting on the auto imported components is gone. The code keeps working correctly, but the auto imported components appear in red. I am using the unplugin-vue-components from @antfu in a vite setup. If I activate vetur back, the highlighting becomes green again, but I do not want to keep it active in order to avoid conflicts.