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. linux下用rpm 安装jdk

    转载自http://blog.csdn.net/ldl22847/article/details/7605650 1.下载jdk的rpm安装包,这里以jdk-7u4-linux-i586.rpm为例进 ...

  2. Python——requests的安装及入门-贴吧爬虫

    一.windows平台下requests的安装 1.win+R,输入cmd,打开命令行窗口,输入命令:pip install requests ,即可自动安装库成功 2.输入命令:pip list,即 ...

  3. CentOS7.3托管磁盘虚拟机扩容数据磁盘

    随着托管磁盘的上线,虚拟机支持的单块磁盘容量从1TB到达了4TB,客户对单块磁盘容量的需求量也会变的很大. 操作之前需要重点查看: 由于扩容磁盘的操作非同小可,一旦哪一步出现问题,就会导致分区损坏,数 ...

  4. 【python】10分钟教你用python下载和拼接微信好友头像图片

    前言 相信微信大家是用得再多也不过了.那么,对于python+微信,又能玩出什么新的花样呢?下面小编就给大家带来一个好玩的东西.用python下载所有的微信好友的头像,然后拼接成一张大图.这样,大家就 ...

  5. c语言数据结构学习心得——栈

    栈(Stack) 只允许在一端进行插入或删除操作的线性表 栈顶(Top):栈中允许进行插入和删除操作的那一端: 栈底(Bottom):固定的,不允许进行插入或删除的另一端 1.栈是受限的线性表,所以自 ...

  6. 【Leetcode】Maximum Product Subarray

    Find the contiguous subarray within an array (containing at least one number) which has the largest ...

  7. C++_代码重用5-类模板

    如果两种类只是数据类型不同,而其他代码是相同的,与其编写新的类声明,不如编写一种泛型(独立于类型的)栈.然后将具体的类型作为参数传递给这个类.这样就可以使用通用的代码生成存储不同类型值的栈. 可以使用 ...

  8. FJOI2019划水记

    Day 0 和 $crk$ 神仙颓废 $crk$ 雀魂一位率 $40%$ $orz$,不知道的人怕不是以为开小号 晚上想早点睡觉,从 9 点躺到 12 点才睡着 Day 1 反正划水,心态良好,全写暴 ...

  9. 116th LeetCode Weekly Contest N-Repeated Element in Size 2N Array

    In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeate ...

  10. HDU - 6188

    用vis表贪心异常方便 #include<bits/stdc++.h> #define rep(i,j,k) for(register int i=j;i<=k;i++) #defi ...