-
命名规范
1.1 所有组件名必须以
h-
开头1.2 css规范
- 不使用id
- 标签统一使用
小写
加-
(短横线) - 类名由以下元素构成
小写字母
-
(短横线)_
(下划线)数字
- 使用 BEM 命名规范:
块__元素--修饰符
例:
.footer__logo--dark (黑暗模式的底部LOGO)
.user-rank__avatar--first (用户棒排名第一的用户头像)
.post-title--top(置顶帖标题) - 减少嵌套,一般情况下最多只用2层嵌套
- 避免使用
/deep/
,如果不可避免要使用的话,应该考虑在组件中提供参数来修改组件样式
1.3 js规范
- 变量名,函数名统一使用小驼峰命名;类名统一使用大驼峰命名
-
其他规范
2.1 统一使用4空格缩进
2.2 组件使用时使用小写加
-
形式:
组件类: HButton
使用:<h-button></h-button>
2.3 参考
h-standard
组件 -
创建新组件
运行
npm run component 组件名 注释
创建组件
-
Notifications
You must be signed in to change notification settings - Fork 2
ZCreturn0/hanser-ui
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|