You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,12 +69,12 @@ What other exciting features are there? Please continue to explore! Or you can c
69
69
- Plugin system design, extending enum functionality through plugin installations
70
70
- Supports type narrowing to enhance type safety<sup>_ TypeScript_</sup>
71
71
- Generates dropdowns from enums, compatible with UI libraries like [Ant Design](https://ant.design/components/overview), [Element Plus](https://element-plus.org/en-US/component/overview), [Material-UI](https://mui.com/material-ui) and more
72
-
- Supports server-side rendering (SSR)
73
72
- Compatible with various environments including Browsers, Node.js, React Native, Taro, and mini-programs
73
+
- Supports server-side rendering (SSR)
74
74
- Compatible with any front-end development framework, including vanilla projects
75
75
- TypeScript‑oriented, providing excellent type inference and code completion capabilities
> If you want to get the custom fields of a known enum item, it is recommended to use the `named` property to access it
366
+
> If you need to get the meta fields of a known enum item, it is recommended to use the `named`and `raw`property, for example: `ColorEnum.named.Red.raw.hex`.
Gets the display name of an enum item according to its value or key. If [localization](#localization)has been enabled, the localized text will be returned.
374
+
Gets the display name of an enum item according to its value or key. If [localization](#localization)is enabled, the localized text will be returned.
374
375
375
376
```js
376
377
WeekEnum.label(1); // Monday
377
-
WeekEnum.label('Monday'); // Monday, here is label, not key
378
+
WeekEnum.label('Monday'); // Monday, this is label, not key
378
379
```
379
380
380
381
---
@@ -386,7 +387,7 @@ WeekEnum.label('Monday'); // Monday, here is label, not key
386
387
Find the key of an enum item by its value. It's also known as [reverse mapping](https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings). If not found, `undefined` is returned.
387
388
388
389
```js
389
-
WeekEnum.key(1); // Monday (here is key, not label)
390
+
WeekEnum.key(1); // Monday (this is key, not label)
0 commit comments