Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
front-document
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huanglu
front-document
Commits
4c80a6d8
Commit
4c80a6d8
authored
Jun 02, 2020
by
huanglu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: 完善文档
parent
ab06eb7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
前端规范.md
前端规范.md
+3
-2
No files found.
前端规范.md
View file @
4c80a6d8
...
...
@@ -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'
....
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment