简体   繁体   English

在VueJS中,在HTML中包含一些组件模板,在PUG / Jade中包含一些模板是一种好习惯吗?

[英]In VueJS, is it good practice to have some component templates in HTML and some templates in PUG / Jade?

Since Vue's component based architecture keeps division of labor in mind, is it a good idea to allow some developers to write templates in HTML and some in PUG as they see fit? 由于Vue的基于组件的体系结构牢记分工,是否允许一些开发人员在他们认为合适的情况下以HTML编写模板和以PUG编写模板是一个好主意? Or should all developers be instructed to stick to the same language? 还是应该指示所有开发人员都使用相同的语言?

What are some drawbacks to allowing this? 允许这样做有哪些缺点?

It would make more sense for everything to be in the same language. 一切都用相同的语言会更有意义。 It means everyone in the company follows 1 style and there's no need to look up syntax if someone is unfamiliar with PUG / HAML etc. It's always better to follow 1 consistent rule. 这意味着公司中的每个人都遵循1样式,如果有人不熟悉PUG / HAML等,则无需查找语法。遵循1一致的规则总是更好。

Obviously you could choose PUG / HAML to be your main choice but whatever you choose all components should be written in the same style and language. 显然,您可以选择PUG / HAML作为您的主要选择,但是无论您选择什么,所有组件都应该以相同的样式和语言编写。

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

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