目录规范
```
.
├── App.Vue # 主应用组件
├── pages.json # 页面路由配置
├── manifest.json # uni配置页
├── main.js # 入口文件
├── package.json # 引入第三方npm包
├── common # 公共 方法 工具等
│ └── utils # 公共 工具
│ └── http-client # 公共 请求方法
│ └── ...
├── components # 公共 UI 组件
│ └── ...
├─- hybrid App端存放本地html文件的目录
├─- platforms 存放各平台专用页面的目录,详见
├── config # 公共 设置
│ └── api.json # 公共 接口设置
│ └── app.json # 公共 url 平台 等设置
│ └── ...
├── pages # 页面
│ ├── login
│ ├── addressbook
| |-- my
| |-- workbench
| |-- message
│ └── ...
|-- subpkgs
|-- xiaocheng
|-- senhuo
|-- xxx
├── plugins # 第三方工具
│ └── ...
├── api
│ └── user.js
│ └── login.js
│ └── ...
├── static # 静态资源
│ └── tab # tab栏图片
│ └── ...
├── store # 状态管理
│ └── modules
│ └── app # 应用级别状态
│ └── auth # 登陆级别状态
│ └── ...
├── styles # 样式管理
│ └── iconfont # 字体icon
│ └── animation # 动画样式
│ └── base # 基础公共样式
│ └── ...
├── mock-server # 数据模块服务
<a name="YQpZQ"></a>
## 代码规范
- 组件命名
首先创建同名目录,组件名称均使用小写字母加 - 拼接,例如<br />address-book.vue
- 组件及页面使用 .vue 文件开发
- js,css等文件命名均使用小写字母加 - 拼接
- 代码格式化
在 hbuilder 中安装 prettier 进行代码格式化<br />![image.png](https://cdn.nlark.com/yuque/0/2022/png/22915529/1649920491258-39a1f20d-379c-4b14-bea5-ed73aef3cadc.png#clientId=u45ae1d5b-da5f-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=377&id=ue1e33b05&margin=%5Bobject%20Object%5D&name=image.png&originHeight=754&originWidth=715&originalType=binary&ratio=1&rotation=0&showTitle=false&size=91487&status=done&style=none&taskId=u98a79a6b-7e14-49ff-8305-86df6e5fb1c&title=&width=357.5)<br />![image.png](https://cdn.nlark.com/yuque/0/2022/png/22915529/1649920519031-282598fd-d087-48a6-9729-5f9256b680fe.png#clientId=u45ae1d5b-da5f-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=184&id=ubf726572&margin=%5Bobject%20Object%5D&name=image.png&originHeight=368&originWidth=735&originalType=binary&ratio=1&rotation=0&showTitle=false&size=52849&status=done&style=none&taskId=u929da7a3-4df8-4170-83a1-4ca1d9f2341&title=&width=367.5)
```javascript
module.exports = {
printWidth: 180,
semi: true,
tabWidth: 4,
useTabs: false,
singleQuote: true,
trailingComma: "none",
bracketSpacing: true,
htmlWhitespaceSensitivity: "ignore",
parsers: {
".jsx": "flow",
".scss": "scss",
".ts": "typescript",
".less": "css",
".vue": "vue",
".nvue": "vue",
".ux": "vue",
".yml": "yaml",
}
}