docs(projects): 添加书写规范文档

This commit is contained in:
Soybean
2021-11-03 00:25:01 +08:00
parent e5d9962a5a
commit d9fd91d137
15 changed files with 646 additions and 484 deletions

20
doc/css书写规范.md Normal file
View File

@ -0,0 +1,20 @@
css书写顺序
1.定位属性position display float left top right bottom overflow clear z-index
2.自身属性width height padding border margin background
3.文字样式font-family font-size font-style font-weight font-varient color
4.文本属性text-align vertical-align text-wrap text-transform text-indent text-decoration letter-spacing word-spacing white-space text-overflow
5.css3中新增属性content box-shadow border-radius transform……
class类名的顺序
1.自定义的class类名(遵循BEM命名法)
2.css插件提供的类名按照以上的css属性对应的顺序
例如自定义类名结合tailwind css
<div class="demo-container absolute flex justify-center items-center left-10px top-12px overflow-hidden w-full h-full p-10px border-1px border-[#f00] m-24px bg-[#fff] text-32px text-[#0f0]"></div>
<style>
.demo-container {
box-shadow: 2px 0 8px 0 rgb(29 35 41 / 5%);
}
</style>

43
doc/vue+TS书写规范.md Normal file
View File

@ -0,0 +1,43 @@
推荐script-setup写法
第一部分书写
template
第二部分
script
一、import的顺序
1.vue模块
2.vue相关类型
3.vue-router模块
4.vue-router相关类型
5.UI框架模块
6.UI框架相关类型
7.第三方依赖
8.第三方依赖相关类型
9.@/enum
10.@/setting
11.@/plugins
12.@/layouts
13.@/views
14.@/components
15.@/hooks
16.@/store
17.@/context
18.@/router
19.@/service
20.@/utils
21.@/interface
22.@/assets
23.相对路径依赖
二、TS类型声明
三、defineProps、defineEmits、defineExpose、withDefaults
四、响应式use函数
五、变量、函数声明
六、vue生命周期函数、nextTick执行