MeterSphere/frontend/代码规范.MD
2020-02-27 17:47:44 +08:00

24 lines
906 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

####文件命名:
- html 小写字母+横线,例如:index.htmlorg-list.html
- js 小写字母+横线,例如:i18n.jsen-US.js
- vue 驼峰命名首字母大写例如Login.vueHeaderUser.vue
####变量命名:
- 常量 大写字母加下划线,例如:const ROLE_ADMIN='admin'
- 变量 驼峰命名首字母小写例如let namelet currentProject
- 方法 驼峰命名首字母小写例如function open(){}function openDialog()
####Vue组件:
- 导出名称 驼峰命名首字母大写以Ms开头例如MsUser
####样式规范:
- 均写入vue文件的<style scope></style>标签内非全局样式必须添加scope
- 修改ElementUI的样式仅在必要情况下写在<style></style>
- 命名 小写字母+横线,例如.menu.header-menu#header-top
####格式要求:
- 遵循.editorconfig
####Vue风格指南:
- https://cn.vuejs.org/v2/style-guide/