ant-design / ant-design/pro-components

🧐[问题] 数据类型疑问 ProFormSelect

Open
#8,726 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

### 🧐 问题描述

关于 ProFormSelect 的数据类型问题确认,我在valueEnum 中设置了 0 1 但是选中后是 字符串,是否是一个合理的处理.

### 💻 示例代码

}
name="in_or_out"
valueEnum={{
1: { text: '范围内报警', status: 'success' },
0: { text: '范围外报警', status: 'success' },
}}
/>

这个数据选择后是字符串`"1"` 不是数字1

Contributor guide

Open the contributing guide

Research direction

Start by locating the ProFormSelect implementation and tracing how valueEnum options are passed into the selected value. Reproduce the supplied example and check the component's documented value type and existing tests, if present. Done should establish whether numeric values are intentionally converted to strings and capture the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.