New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[refactor] Upload: 上传组件重写 #1298
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
老代码记得拷一份到 https://github.com/zent-contrib/zent-compat
packages/zent/src/utils/isInteger.ts
Outdated
export default function isInteger(value: string | number): boolean { | ||
return /^[\-+]?\d*$/.test(value.toString()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉,跟产品确认保留几位小数
fileList: files, | ||
}); | ||
|
||
if (detail && detail.type === 'retry') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detail?.type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
markdown 没有配置 optional chaining 语法的解析,无法使用
} | ||
|
||
return `${ | ||
isInteger(formattedSize) ? formattedSize : formattedSize.toFixed(toFixed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
统一保留 n 位小数,跟产品确认
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
先不做格式化处理,直接显示除后的数字,如果需要格式化使用者可以用 tips 处理
除不尽的情况总要考虑吧,默认留2位小数吧
…On Thu, Dec 26, 2019, 15:45 KainStar ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In packages/zent/src/utils/isInteger.ts
<#1298 (comment)>:
> +export default function isInteger(value: string | number): boolean {
+ return /^[\-+]?\d*$/.test(value.toString());
+}
先不做格式化处理,直接显示除后的数字,如果需要格式化使用者可以用 tips 处理
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1298?email_source=notifications&email_token=AAFROECVJ2EGSEAOWNW4URLQ2ROLFA5CNFSM4J3JQBLKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCQG325Y#discussion_r361391783>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFROEFH4ZYHPTN3TIMFEXLQ2ROLFANCNFSM4J3JQBLA>
.
|
外部主动设置成除不尽小数的情况感觉也不多,一般都会设置成一个经过计算的正常数字吧 |
next: