How can I enable syntax highlighting for .vue files in Atom?

守給你的承諾、 提交于 2020-01-22 13:48:28

问题


I'm starting up with Vue.js. The first problem I've run into is that my IDE (Atom) doesn't beautify my .vue files. It's all just white text.

How can I make Atom highlight .vue files properly?


回答1:


language-vue package adds syntax highlighting to Vue components.

There is also another package to beautify your code. Install atom-beautify package. It has Vue beautifier preinstalled.




回答2:


The Vue.js project maintains Awesome Vue.js, "a curated list of awesome things related to Vue.js".

This includes a list of useful Atom packages for Vue.js:

  • language-vue@atom.io - Vue component file syntax for Atom.
  • language-vue-component@atom.io - Adds syntax highlighting to Vue Component files in Atom.
  • vue-autocomplete@atom.io - Vue.js 1.0+ autocomplete for Atom.
  • vue-snippets@atom.io - Atom snippets for Vue component files.
  • vue-autocompile@atom.io - Auto compile vue file on save.
  • lint-sass-vue@atom.io - Atom.io package to lint Sass/SCSS in .vue files.
  • vuejs2-snippets@atom.io - Atom snippets for javascript and components, including lifecycle hooks, directives, properties, vuex, vue-router, vue-i18n support.
  • vue2-autocomplete@atom.io - Vue.js 2.0+ autocomplete for Atom.

Note that currently the language-vue and language-vue-component do not play nicely together, as discussed here. For now, for syntax highlighting in Atom your best bet is language-vue only.



来源:https://stackoverflow.com/questions/45227611/how-can-i-enable-syntax-highlighting-for-vue-files-in-atom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!