vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 594 forks source link

Question: Support for HTML highlighting in "template literal" strings in .JS files? #3716

Open wallheater opened 10 months ago

wallheater commented 10 months ago

I am working with Vue 3 without a build/compile step, using:

...just like this example.

It is working well for me, except there is no syntax highlighting in the template content in VS Code, when in the JavaScript language mode. (And of course in HTML mode there is no syntax highlighting in the JS.)

Today I added the Vetur extension and tried all the vue-* language modes, and none seems to detect the template block. Is there any way to enable this in the extension?

(Also, is it correct to call this a "template literal"? It's been hard to google this topic.)

Similar concept in the es6-string-html extension, which depends on /*html*/ comments.

Code example linked above:

// my-component.js
export default {
  data() {
    return { count: 0 }
  },
  template: `<div>count is {{ count }}</div>`
}