简体   繁体   English

格式化字符串变量更漂亮

[英]Prettier to format string vars

I need a code editor to display and edit html code in my vue.js project.我需要一个代码编辑器来显示和编辑 vue.js 项目中的 html 代码。 I have the html codes in DB and I need to format it before displays.我在 DB 中有 html 代码,我需要在显示之前对其进行格式化。 I know prettier can do that with function prettier.format() but I am unable to achieve that.我知道 prettier 可以用 function prettier.format() 做到这一点,但我无法做到这一点。 If any one knows how to do this or another way or technology would be appreciated.如果有人知道如何做到这一点或其他方式或技术,将不胜感激。

PS: Only found how to format.vue files but no how to use prettier.format in browser. PS:只找到了如何格式化.vue文件,没有找到如何在浏览器中使用prettier.format。

This documentation page describes how to use Prettier in the browser: https://prettier.io/docs/en/browser.html本文档页面描述了如何在浏览器中使用Prettier:https://prettier.io/docs/en/browser.html

Feel free to ask questions in the comments if something isn't clear there.如果有不清楚的地方,请随时在评论中提问。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM