Skip to content

Conversation

@davedavehong
Copy link

Changes you made in this pull request:

  • numberInput组件增加dynamicDecimal属性,支持用户保留完整的小数位数
  • dynamicDecimal优先级高于固定位数的dynamicDecimal属性

Copy link
Contributor

@cpylua cpylua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

搜一下用到 decimal 这个 props 的地方,我感觉有遗漏的地方,没这么简单。

Comment on lines 112 to 114
decimalPlaces === DYNAMIC_DECIMAL_SIGN
? getDecimalsLength(decimal)
: decimalPlaces
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

逻辑收到 getDecimalsLength 里面去

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 如果觉得有遗漏的地方,需要提出具体哪里遗漏
  2. getDecimalsLength 这个方法,如果只有这个地方用到,我是建议保持现状,职责单一

}

// 表示小数点位数取用户实际输入的小数点位数
const DYNAMIC_DECIMAL_SIGN = -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得 Infinity 更合适

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants