[Vuejs]-Vue not highlighting components inside template on vscode

0👍

Sometimes, this happens as a glitch when the memory used by VSCode gets too full with undo states. Other times, it’s because VSCode can’t case match the component to the import (i.e. import Thing from './Thing.vue' !== <thing/>)

In most cases, Vetur takes a nap and doesn’t wake up…
See this similar question.

Working with Vue with Typescript, I found that if you don’t wrap a prop-passed-as-type in parenthesis, the syntax highlighting below will get messed up:

<ThingWithTypedProp
  :typed-prop="foo as Bar"
/>
vs
<ThingWithTypedProp
  :typed-prop="(foo as Bar)"
/>

Props-passed-as-type Syntax highlighting

This does not apply if you are working with pure Vuejs

Leave a comment