File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
frontend/best-practices/web-project Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 12
12
- 统一使用 ` Router Service ` 进行页面跳转,并且保证 一个 module 一个 router
13
13
- 针对 ` SharedModule ` (无论全局 shared 还是 子模块的 shared )中的 ` models ` ` utils ` 等不在 ` SharedModule ` 中导出的内容,请添加相应的 ` index.ts ` 索引。
14
14
- ` CoreModule ` 中的 ` services ` ` guards ` 同理
15
- - 这样做的好处是,当目录结构发生改变或者文件名发生变化,但相应的 ` model ` ` util ` 导出的内容不变的时候,对于外部使用的 ` import ` 路径不会发生改变,不会出现牵一发而动全身的情况。
15
+ - 这样做的好处是,当目录结构发生改变或者文件名发生变化,但相应的 ` model ` ` util ` 导出的内容不变的时候,对于外部使用的 ` import ` 路径不会发生改变,不会出现牵一发而动全身的情况。
16
+
17
+ ### 日期格式化
18
+
19
+ 项目中有工具库 ` DateUtil ` 以及过滤器 ` _date ` ,在函数库 [ date-fns] ( https://date-fns.org/ ) 基础上作了一层封装。使用时注意以下几点:
20
+ - 日期显示格式、提交格式,务必依据接口具体情况具体处理,不需要格式化的地方不要进行格式化
21
+ - ` dateFns ` 在处理字符串格式日期时会做夏令时兼容,这点会将'1991-04-14'格式化成'1991-04-13',如果依赖它处理 ` Date ` 要特别注意
You can’t perform that action at this time.
0 commit comments