Vue3中如何阻止VSCode的IntelliSense在自动补全时为组件Prop添加column字段
column Field for Custom Vue Components in VSCode I've been stuck with this issue for a while now—VSCode's IntelliSense keeps incorrectly adding a column field when auto-completing props for my custom Vue component. Does anyone know how to stop this behavior?
Here's my setup:
- I'm using the Vetur v0.34.1 extension
- I haven't configured any custom Vetur settings
- My custom
Gridcomponent's prop definition looks like this:
<script lang="ts"> import { toRefs, defineComponent } from 'vue'; export default defineComponent({ name: 'Grid', props: { alignItems: { type: String, default: null, validator: (val: string): boolean => ['start', 'center', 'end', 'stretch'].includes(val), }, // ... other props omitted } }) </script>
Update 1: After following a step-by-step solution to auto-generate tags and props for custom components, I now get the correct IntelliSense auto-completion results. But I'm wondering how to disable those incorrect auto-completion options that still show up?
Update 2: After uninstalling Vetur and switching to the Volar extension, everything works perfectly in my TypeScript environment—the incorrect completion issue is completely gone.
内容的提问来源于stack exchange,提问作者Mike

