Project development specification configuration

insert image description here

The recent work is relatively easy. Looking at the several projects maintained, the development specifications are not very clear, the code is confusing, and maintenance is quite troublesome. So summarize the standard operation of project development.

According to my personal development habits, I will briefly introduce it from two aspects: commonly used variables, form validation and css (scss) style

common variable

Generally create a folder consttants, and then common variables of related modules are created and added under this folder

For example:
create an ad.js/ad.ts file under the constants folder

export const CLASS_CANVAS_ID = 'classImgCanvas'
export const CROP_AVATAR_CANVAS_ID = 'cropAvatarCanvas'
export const INDEX_ACTION_SHEET = ['个人信息', '升级账户', '班级管理']
export const MAP_INFO_ACTION_SHEET = ['拨打电话', '一键导航']

//使用枚举
export enum IndexActionSheet {
  INFO = 0,
  ACCOUNT = 1,
  CLASS = 2
}
export enum MapInfoActionSheet {
  PHONE = 0,
  NAV = 1
}
export enum PlaceOptionEnum {
  SCHOOL = 0,
  WORK = 1
}
export enum ActionType {
  CREATE,
  UPDATE
}

Guess you like

Origin blog.csdn.net/qq_39197547/article/details/125764258