issues
search
youlaitech
/
vue3-element-admin
🔥基于 vue3 + vite5 + typescript + element-plus 构建的后台管理前端模板(配套后端源码),vue-element-admin 的 vue3 版本。
https://vue3.youlai.tech
MIT License
1.4k
stars
371
forks
source link
perf(Enum): :zap: enum关键字前面加上const修饰
#51
Closed
cshaptx4869
closed
7 months ago
cshaptx4869
commented
7 months ago
原因:
Enum 成员值都是只读的,不能重新赋值。为了让这一点更醒目,通常会在 enum 关键字前面加上 const 修饰。
加上 const 还有一个好处,就是编译为 JavaScript 代码后,代码中 Enum 成员会被替换成对应的值,这样能提高性能表现。
原因: