Commit 4c80a6d8 authored by huanglu's avatar huanglu

docs: 完善文档

parent ab06eb7b
......@@ -13,7 +13,8 @@
- 目录下的文件一般情况下不能使用其父级目录下的其他目录文件(公共组件和工具除外),如果要使用,可以考虑抽离出来,做成公共组件或者工具。
- 在编写组件时,每个组件都放在一个独立的目录下面,目录名称即组件名,通过目录下的index.(jsx?|tsx?|vue)方式导出
- 工具函数,统一在 src/utils 建议使用 export default 导出其所有的工具函数,并在使用时,加上其模块名 (可读性)
```
```javascript
// src/utils/index.js
export default {
dateFormat,
......@@ -21,7 +22,7 @@
}
```
```
```javascript
// 使用时
import utils from '@/utils'
....
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment