...
|
...
|
@@ -13,23 +13,34 @@ |
|
|
## 注释
|
|
|
* 为每个你创建的JS文件添加注释
|
|
|
```
|
|
|
/**
|
|
|
* 对文件实现功能的描述
|
|
|
* @date: 2016-11-11
|
|
|
* @author: name<emial@yoho.cn>
|
|
|
*/
|
|
|
/**
|
|
|
* 对文件实现功能的描述
|
|
|
* @date: 2016-11-11
|
|
|
* @author: name<emial@yoho.cn>
|
|
|
*/
|
|
|
```
|
|
|
* 为重要的函数添加注释
|
|
|
```
|
|
|
/**
|
|
|
* 对函数功能的说明
|
|
|
* @params name paramType 参数描述
|
|
|
* @return name returnType 返回值描述
|
|
|
*/
|
|
|
/**
|
|
|
* 对函数功能的说明
|
|
|
* @params name paramType 参数描述
|
|
|
* @return name returnType 返回值描述
|
|
|
*/
|
|
|
```
|
|
|
* 为重要的代码、逻辑复杂的代码或者有特殊处理的代码添加注释
|
|
|
```
|
|
|
// Your comments for the code
|
|
|
// Your comments for the code
|
|
|
```
|
|
|
* 减少不必要的注释
|
|
|
类似于:进入循环,循环结束等垃圾话的注释请谨慎添加,大家都是程序员,都懂的 |
|
|
\ No newline at end of file |
|
|
类似于:进入循环,循环结束等垃圾话的注释请谨慎添加,大家都是程序员,都懂的
|
|
|
|
|
|
|
|
|
## html
|
|
|
* 见名知意,不要有1,2,3这种名字出现
|
|
|
* class、id等属性命名为中划线分隔小写单词
|
|
|
* html中请不要出现不必要的嵌套以及不要将标签滥用,比如使用`a`标签作为不跳转的按钮的标签
|
|
|
* 属性按顺序出现:`id -> class -> name -> data-* -> src,for,type,href -> title,alt -> aria-*,role`
|
|
|
|
|
|
## [js](./js.md)
|
|
|
|
|
|
## [css](./css.md) |
|
|
\ No newline at end of file |
...
|
...
|
|