Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How enable Typescript typing and intellisense for vue props in template in VS Code?

I'm working with Vue and VS Code with vetur extension installed.

I've defined a MyClass class with two public attributes. Inside the "script" section i'm able to get proper intelisense for the value property.

But I cannot check intellisense nor typing enforcement inside the template. as the image below.

enter image description here

I should see only enabled and number.

How can I configure my VS Code to get this type enforcement on the template?

like image 869
Daniel Santos Avatar asked Dec 06 '18 14:12

Daniel Santos


People also ask

How do I add a Vetur in VS Code?

The Vetur extension supplies Vue. js language features (syntax highlighting, IntelliSense, snippets, formatting) to VS Code. From the notification, press Install to download and install the Vetur extension. You should see the Vetur extension Installing in the Extensions view.

What is IntelliSense VS Code?

IntelliSense is a general term for various code editing features including: code completion, parameter info, quick info, and member lists. IntelliSense features are sometimes called by other names such as "code completion", "content assist", and "code hinting."

What is Vetur?

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.


1 Answers

Using Vetur extension:

In settings:

"vetur.experimental.templateInterpolationService": true,

enter image description here

like image 130
Alex Avatar answered Oct 14 '22 05:10

Alex