Describe the bug
While utilizing the Create Data
and Update Data
components for data encapsulation, I have encountered an issue where numeric values that begin with a zero are automatically stripped of their leading zeros. For instance, the number ' 029
' is incorrectly transformed into ' 29
'. This behavior is problematic as it can lead to data inconsistency and errors in applications that rely on the preservation of leading zeros for significance or formatting purposes.
Browser and Version
- Edge, Chrome
- Version: 1.0.7 - 1.0.9
1条答案
按热度按时间jjjwad0x1#
要解决
Create Data
和Update Data
组件中数值被去除前导零的问题,你需要确保这些值被视为字符串而非数字。这可以通过修改onChange
处理器来实现,使其将输入处理为字符串。以下是如何修改
onChange
处理器以使InputComponent
的值被视为字符串的示例:通过确保
value
被视为字符串,你可以防止前导零被去除。这种方法应该应用于所有可能输入数值的相关输入组件。