Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
app
Project
Project
Details
Activity
Releases
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
hel-guide
app
Commits
bf99818d
Commit
bf99818d
authored
Aug 17, 2017
by
宋帮潮
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates ionic/ionic-code-style.md
Auto commit by GitBook Editor
parent
fbc3d836
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
43 deletions
+42
-43
ionic-code-style.md
ionic/ionic-code-style.md
+42
-43
No files found.
ionic/ionic-code-style.md
View file @
bf99818d
<<<<<<< HEAD
# 前端开发规范
---
### I. 文件命名规范
*
*html
,
js,scss文件命名统一用小写的英文字母且三个文件名必须相同,若文件名过长可以简写或者有‘-’链接,不得包含汉字空格和特殊字符。**
### 原则:
*
1)方便理解,见名知义
* 2)方便查找
![](/picture/h.png)
### II. controller命名规范
**
控制器命名统一用 文件名+Ctrl,若文件名拼接则第一个单词首字母小写其余单词首字母大写,如下图所示:**
![](/picture/h4.png)
### III. SCSS文件注册
**
当创建一个新SCSS文件后,要在theme目录下app.core.scss文件里import,如下图所示:**
![](/picture/h1.png)
![](/picture/h3.png)
### IV. 前端样式开发注意点
*
1)class选择器在SCSS文件里编写样式时要注意在前面加‘.’ ,如下图所示:
![](/picture/a.png)
*
2)前端布局开发,建议使用flex布局(方便)
*
3)前端样式在写宽度 with时,必须使用百分号(%)来确定宽度,不允许使用px。原因:使用%来确定with,不会随着屏幕的增大而导致样式改变。如下图所示:
![](/picture/a1.png)
=======
# 前端开发规范
---
### I. 文件命名规范
**html,js,scss文件命名统一用小写的英文字母且三个文件名必须相同,若文件名过长可以简写或者有‘-’链接,不得包含汉字空格和特殊字符。**
### 原则:
*
1)方便理解,见名知义
*
2)方便查找
!
[](
/picture/h.png
)
### II. controller命名规范
**控制器命名统一用 文件名+Ctrl,若文件名拼接则第一个单词首字母小写其余单词首字母大写,如下图所示:**
![](
/picture/h4.png
)
### III. SCSS文件注册
**当创建一个新SCSS文件后,要在theme目录下app.core.scss文件里import,如下图所示:**
![](
/picture/h1.png
)
![](
/picture/h3.png
)
### IV. 前端样式开发注意点
*
1)class选择器在SCSS文件里编写样式时要注意在前面加‘.’ ,如下图所示:
![](
/picture/a.png
)
*
2)前端布局开发,建议使用flex布局(方便)
*
3)前端样式在写宽度 with时,必须使用百分号(%)来确定宽度,不允许使用px。原因:使用%来确定with,不会随着屏幕的增大而导致样式改变。如下图所示:
![](
/picture/a1.png
)
# 前端开发规范
---
...
...
@@ -84,4 +83,4 @@
![](
/picture/a2.png
)
>>>>>>> 21a37278d7723aa9b04782fd221ddc9df4029858
宋帮潮
@14700
mentioned in commit
9d1b9082
·
Aug 17, 2017
mentioned in commit
9d1b9082
mentioned in commit 9d1b90827dcfba54d928db95e0079ec2f9d928a8
Toggle commit list
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