I am starting to learn Vue, using Visual Studio Code. I downloaded an extension that adds Vue code snippets (Vue 2 Snippets by hallowtree).
When I start to type "v"
in a Vue template, suggestions are shown (v-on
, v-bind
, etc.),
but afterward, no suggestions or autocompletions are shown.
In the following example template, v-on
is suggested, but afterward, no suggestions for "click"
or any other event. Also, nothing is suggested after "@"
:
<button v-on:click="changeLink">Click to change Link</button>
<button @click="changeLink">Click to change Link</button>
And in this example, v-bind
is suggested, but afterward, no suggestions for "href"
or any other HTML properties/attributes:
<a v-bind:href="link">Link</a>
<a :href="link">Link</a>
Although it's good for me for practicing, it will become a liability. Are there any extensions, options, or commands I can set up to improve the developer experience?
You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.) in JavaScript). Tip: The suggestions widget supports CamelCase filtering, meaning you can type the letters which are upper cased in a method name to limit the suggestions.
Vetur provides syntax highlighting for all your Vue source code files. Without Vetur, a .vue file will be displayed in this way by VS Code: with Vetur installed: VS Code is able to recognize the type of code contained in a file from its extension.
Vetur has had experimental template interpolation for autocomplete and "diagnostics / hover / definition / references" within HTML templates since February 2019.
Enable the Vetur › Experimental: Template Interpolation Service
option in your VS Code settings to turn on this feature.
add the Vetur extension on visual-studio-code
it includes many other nice features besides auto completion vue code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With