A. Necessary
  1. Multiple-word for component’s name
  2. Data for component must be a function
  3. The definition of prop should be as detailed as possible (at least specified its type)
  4. Always use key with v-for
  5. Never use v-if & v-for to the same element (v-for has a higher priority than v-if when Vue deal with the directives)
  6. Set the scope for the component style, but use class rather than scoped feature
  7. Custom private attributes use the $_ prefix
B. Highlycommended
  1. Separate each component into files
  2. The filename of a single file component should always be either capitalized or always crosslinked
  3. The underlying components for which a particular style and convention are applied (that is, components that show classes, Illogical or stateless) should all begin with a specific prefix
  4. Components that are used only once per page should be named with “the” prefix
  5. Child components that are tightly coupled with the parent component (that means a component only makes sense in the context of a parent component) should be prefixed with the parent component name.
  6. Component names should begin with high-level (usually generic) words and end with descriptive modifiers.
  7. In single file components, string templates and components with no content in JSX should be self-closed-but never do so in DOM templates.
  8. For most projects, component names should always be PascalCase in single file components and string templates but always kebab-case in DOM templates
  9. The components name should be PascalCase in JS/JSX, but for applications that define global components only through Vue.component, kebab-case is recommended as an alternative
  10. Component names should tend to be full words instead of abbreviations
  11. When declaring prop, it should always be named with camelCase. But in templates & JSX you should use kebab-case
  12. Seprating multiple properties of an object by multiple rows that can improve the readability of the code
  13. Component templates should contain only simple expressions, and complex expressions should be refactored into computed properties or methods
  14. Divide complex computational attributes into as many simpler ones as possible
  15. Non-empty HTML attribute values should always be quoted
  16. Instruction abbreviation
C. Recommended 
  1. There should be a uniform order of options for components/instances (default order recommended:https://cn.vuejs.org/v2/style-guide/#%E7%BB%84%E4%BB%B6-%E5%AE%9E%E4%BE%8B%E7%9A%84%E9%80%89%E9%A1%B9%E7%9A%84%E9%A1%BA%E5%BA%8F-%E6%8E%A8%E8%8D%90)
  2. The properties of elements (including components) should have a uniform order (default order recommended: https://cn.vuejs.org/v2/style-guide/#%E5%85%83%E7%B4%A0%E7%89%B9%E6%80%A7%E7%9A%84%E9%A1%BA%E5%BA%8F-%E6%8E%A8%E8%8D%90)
  3. Adding blank lines between multiple attributes can improve readability when components begin to be dense or difficult to read
  4. Single-file components should always keep the script template and style tags in the same order. And style should be at the end, because the other two tags must have at least one.
D. Be Attention (to use these as follow)
  1. Use v-if/v-else-if/v-else without using key
  2. A large number of element selectors appear in scoped
  3. Hidden parent-child component communication (use this.$parent or modify prop)
  4. Global State Management without Flux (manage global state by using this.$root or a global event bus)

All these referred to  https://cn.vuejs.org/v2/style-guide/

Notes about Vue Style Guide的更多相关文章

  1. Google C++ Style Guide

    Background C++ is one of the main development languages used by many of Google's open-source project ...

  2. python coding style guide 的高速落地实践

    python coding style guide 的高速落地实践 机器和人各有所长,如coding style检查这样的可自己主动化的工作理应交给机器去完毕,故发此文帮助你在几分钟内实现coding ...

  3. python coding style guide 的快速落地实践——业内python 编码风格就pep8和谷歌可以认作标准

    python coding style guide 的快速落地实践 机器和人各有所长,如coding style检查这种可自动化的工作理应交给机器去完成,故发此文帮助你在几分钟内实现coding st ...

  4. 与你相遇好幸运,The Moe Node.js Code Style Guide

    The Moe Node.js Code Style Guide  By 一个最萌的开发者 @2016.9.21 >>代码是人来阅读的,格式规范的代码是对编程人员最好的礼物 :) > ...

  5. 使用tdcss.js轻松制作自己的style guide

    http://jakobloekke.github.io/tdcss.js/ 在前端开发中,如果能够有一个style guide对于设计来说就显得专业稳定,一致性.在上述链接中,有一个tdcss.js ...

  6. Google C++ Style Guide在C++11普及后的变化

    转 http://www.cnblogs.com/chen3feng/p/5972967.html?from=timeline&isappinstalled=0&lwfrom=user ...

  7. Common Lisp Style Guide - Ariel Networks Labs

    Common Lisp Style Guide - Ariel Networks Labs Common Lisp Style Guide

  8. 一张图总结Google C++编程规范(Google C++ Style Guide)

    Google C++ Style Guide是一份不错的C++编码指南,我制作了一张比較全面的说明图,能够在短时间内高速掌握规范的重点内容.只是规范毕竟是人定的,记得活学活用.看图前别忘了阅读以下三条 ...

  9. Airbnb JavaScript Style Guide

      Airbnb JavaScript Style Guide() { 用更合理的方式写 JavaScript    ES5 的编码规范请查看版本一,版本二. 翻译自 Airbnb JavaScrip ...

随机推荐

  1. [APIO2009]抢掠计划 tarjan缩点+spfa BZOJ1179

    题目描述 Siruseri 城中的道路都是单向的.不同的道路由路口连接.按照法律的规定, 在每个路口都设立了一个 Siruseri 银行的 ATM 取款机.令人奇怪的是,Siruseri 的酒吧也都设 ...

  2. REST模式中HTTP请求方法(GET,POST,PUT,DELETE)

    一直在测试REST模式的WEB SERVICE接口,客户端的HTTP的请求方式一般分为四种:GET.POST.PUT.DELETE,这四种请求方式有什么不同呢.简单的说,GET就是获取资源,POST就 ...

  3. Android 系统特有的类介绍及使用

    1.Content类 在应用程序中Context的具体实现子类就是:Activity,Service,Application.可以把它理解成存储东西的仓库. 常用的上下文一般是类名.class或类名. ...

  4. thinkphp3.2.3 批量包含文件

    自己瞎写的...凑合看吧...核心就是用正则 表达式 或者 字符串 str_replace 进行 替换....... /** * 批量包含---,不能递归包含!!! 请不要在目标目录 包含 文件夹,因 ...

  5. 分享一个大型进销存供应链项目(多层架构、分布式WCF多服务器部署、微软企业库架构)

    项目源码下载:  WWW.DI81.COM 分享一个大型进销存供应链项目(多层架构.分布式WCF多服务器部署.微软企业库架构) 这是一个比较大型的项目,准备开源了.支持N家门店同时操作.远程WCF+企 ...

  6. POJ_3069 Saruman's Army 【贪心】

    一.题面 POJ3069 二.题意分析 我的理解是,可以在每个点设置一个监测点,能够监测到范围R内的所有其他点,那么问给出N个点的一维位置,需要在其中挑多少个监测点把所有点都监测到. 贪心解决: 1. ...

  7. WPF 布局

    WPF布局原则 WPF窗口只能包含单个元素,为在WPF窗口中放置多个元素并创建更贴近使用的用户界面,需要在窗口上放置一个容器,然后在这个容器中添加其他元素 遵循以下几条重要原则 不应显式设定元素(如控 ...

  8. SiteServer CMS简介

    SiteServer CMS 是中国在.NET平台下.强大的企业站开源CMS内容管理系统和网站群系统. 能够最低的成本.最少的人力投入在最短的时间内架设好一个功能齐全.性能优异.规模庞大并易于维护的网 ...

  9. 尺取法 javascript算法

    给定长度为n的数列整数a0,a1……an-1 以及整数S.求出总和不小于S的连续子序列的长度的最小值.如果解不存在,则输出0. 输入 n=10 S=15 a=[5,1,3,5,10,7,4,9,2,8 ...

  10. IT职场?未来?

    转自 IT职场?未来? 不能否认,有些技术大牛,生活也过的不错,工资不少挣.但是这种人,本来就不多啊,很少啊.这些人一般都是小时候就搞程序的,你觉得你半路出家,能变成这种超级牛人么?? 而且这些牛人, ...