Reputation: 1
I cant get syntax highlighting/intellisense to work with volar when using defineComponent. I have:
I've added
"vueCompilerOptions": {
"optionsWrapper": [
"(await import('vue')).defineComponent(",
")"
],
to my tsconfig.
I have a component FooComponent:
<template lang="pug">
div(:id="test.foo.bar")
</template>
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
setup() {
const test = {
foo: {
bar: "test",
},
};
return { test };
},
});
</script>
Autocomplete works inside of the defineComponent block:
(i hover over test
in defineComponent
and it shows the object structure)
but not inside of the template:
(i try to autocomplete test.foo.
but bar
is not suggested)
image: autocomplete not working
Hovering over test
doesnt even show anything.
I have tried everything at this point, i cant get this to work. Does anyone have suggestions on how to solve this?
Upvotes: 0
Views: 1007
Reputation: 44
Try modifying the tsconfig file as follows
"vueCompilerOptions": {
"target": 2.7, // or 3 (vue version in use)
"extensions": [
".vue"
]
}
Upvotes: 1