Skip to content
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

feat: button #730

Merged
merged 1 commit into from
May 18, 2023
Merged

feat: button #730

merged 1 commit into from
May 18, 2023

Conversation

jc9702507
Copy link
Collaborator

@jc9702507 jc9702507 commented May 18, 2023

  • button 可使用formType

@github-actions
Copy link
Contributor

github-actions bot commented May 18, 2023

🎊 PR Preview d97629f has been successfully built and deployed to https://ant-design-ant-design-mini-preview-pr-730.surge.sh

🕐 Build time: 226.883s

🤖 By surge-preview

@@ -2,7 +2,7 @@


<button
form-type="{{htmlType}}"
form-type="{{formType}}"
hover-class="{{utils.getHoverClass(loading, type, activeClassName)}}"
scope="{{scope}}"
onTap="{{onTap ? 'onTap' : ''}}"
Copy link
Contributor

Choose a reason for hiding this comment

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

代码修补补丁如下,请允许我做一个简要的代码评审。

修补前后文件只有一行不同,在第二行代码中将 form-type="{{htmlType}}" 改为了 form-type="{{formType}}"。这个修补对于代码的功能没有影响,只是改变了 HTML 属性的名称。

在此代码段中,没有安全隐患或性能问题,并且对于功能实现来说也无需进行进一步的优化。如果只有这一行代码的更改且符合编码规范,那么这个代码提交应该是可以接受的。

@@ -82,6 +82,6 @@ export interface IButtonProps extends IBaseProps {

export const ButtonDefaultProps: Partial<IButtonProps> = {
type: 'default',
htmlType: 'button',
formType: 'button',
size: 'medium',
};
Copy link
Contributor

Choose a reason for hiding this comment

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

这个代码补丁对 interface IButtonProps 进行了修改,将 htmlType 字段更名为 formType。同时,在默认属性中,也将 htmlType 改为 formType

看起来这些代码变更的类型检查应该不会引入风险。可以尝试在现有业务场景中进行测试以确保没有破坏原有逻辑。

关于代码改进,建议增加注释以提高代码可读性和可维护性。另外,如果相关规范存在,可以遵守其命名约定。例如,可以使用全称 formButtonType 来表示 formType

@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (140f09c) 24.01% compared to head (d97629f) 24.01%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #730   +/-   ##
=======================================
  Coverage   24.01%   24.01%           
=======================================
  Files         158      158           
  Lines        3339     3339           
  Branches      875      875           
=======================================
  Hits          802      802           
  Misses       2206     2206           
  Partials      331      331           
Impacted Files Coverage Δ
src/Button/props.ts 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jc9702507 jc9702507 merged commit 372a2f0 into master May 18, 2023
@jc9702507 jc9702507 changed the title fix: button feat: button May 18, 2023
@github-actions github-actions bot mentioned this pull request May 18, 2023
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.

1 participant