简体   繁体   English

VSCode 语法突出显示不适用于 Vue / Vetur

[英]VSCode Syntax Highlighting not working with Vue / Vetur

For the last week or so, every.VUE file I work with has no syntax highlighting.在过去一周左右的时间里,我使用的每个.VUE 文件都没有语法高亮显示。 I usually have the extension Vetur to help with synthax highlighting and other tweaks to.VUE files.我通常有扩展Vetur来帮助突出显示合成器和对 .VUE 文件进行其他调整。

Things I've tried so far:到目前为止我尝试过的事情:

  • uninstall/reinstall Vetur卸载/重新安装 Vetur
  • change file associations in VScode在 VScode 中更改文件关联
  • make sure.vue files have no errors确保.vue 文件没有错误

][1]

As i see for lang="pug" there is no needs to use other extension as like below:正如我看到的 lang="pug" 没有必要使用其他扩展,如下所示:

https://vuejs.github.io/vetur/highlighting.html#custom-blockhttps://vuejs.github.io/vetur/highlighting.html#custom-block

So I think the problem may be on your project file, please check new vue project to be sure that the problem is not from your files and config of the project !所以我认为问题可能出在您的项目文件上,请检查新的 vue 项目以确保问题不是来自您的文件和项目的配置!

You can install 'Vue 3 Support - All In One' from extensions in vs code.您可以从 vs code 中的扩展安装“Vue 3 Support - All In One”。 Then the issue with syntax highlighting will fix.然后语法突出显示的问题将得到解决。

As Sebastian Brosch said in a reply正如塞巴斯蒂安·布罗施在回复中所说

This worked for me: https://github.com/vuejs/vetur/blob/master/docs/FAQ.md#no-syntax-highlighting--no-language-features-working这对我有用:https://github.com/vuejs/vetur/blob/master/docs/FAQ.md#no-syntax-highlighting--no-language-features-working

TLDR: Run command reinstall command in vscode and select vetur extension TLDR:在 vscode 和 select vetur 扩展中运行命令重新安装命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用户片段在 VScode 中不适用于 Vetur pacakge - User snippets is not working with Vetur pacakge in VScode VSCode(Vetur) 无法识别组件中的自定义 Vue 属性 - VSCode(Vetur) does not recognize customized Vue property in component Vue.js VSCode Vetur Emmet 和脚手架代码段无法识别 - Vue.js VSCode Vetur Emmet and Scaffold Snippets not recognized 如何在 VSCode vetur Vue 项目中禁用“vue/custom-event-name-casing”错误? - How disable “vue/custom-event-name-casing” errors in VSCode vetur Vue project? vue - 自定义块 - 语法高亮 - vue - custom blocks - syntax highlighting VSCode没有将双引号更改为单引号<template>使用 Vetur 和 Prettier 以及 Vue-Cli 3 时</template> - VSCode not changing double quotes to single quotes in <template> when using Vetur and Prettier and Vue-Cli 3 WebStorm 未在文件上显示.vue 语法突出显示,但在另一个文件上 - WebStorm not showing .vue syntax highlighting on on file but is on another 如何将Vue语法高亮显示到JSP文件中 - How add Vue syntax highlighting into JSP file 如何在Eclipse中为.Vue文件添加语法高亮显示 - How to add Syntax highlighting for .Vue files in Eclipse VSCode 中 *.vue 文件的自动格式化不起作用 - Autoformatting of *.vue files in VSCode not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM