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

fix: Add closeIcon for Tabs.Tabpane #23992

Merged
merged 3 commits into from May 11, 2020

Conversation

njmqd
Copy link
Contributor

@njmqd njmqd commented May 9, 2020

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

close #23958

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Tabs support closeIcon of Tabpane
🇨🇳 Chinese Tabs.Tabpane 新增 closeIcon 属性支持自定义关闭图标。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

View rendered components/tabs/demo/editable-card.md
View rendered components/tabs/index.en-US.md
View rendered components/tabs/index.zh-CN.md

@njmqd njmqd changed the base branch from master to feature May 9, 2020 06:31
@ant-design-bot
Copy link
Contributor

ant-design-bot commented May 9, 2020

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 9, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5cc29d2:

Sandbox Source
antd reproduction template Configuration

@@ -49,3 +49,4 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false |
| key | 对应 activeKey | string | 无 |
| tab | 选项卡头显示文字 | string\|ReactNode | 无 |
| closeIcon | 自定义关闭图标 | ReactNode | 无 |
Copy link
Member

Choose a reason for hiding this comment

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

声明一下只在 editable card 类型下生效。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false |
| key | 对应 activeKey | string | 无 |
| tab | 选项卡头显示文字 | string\|ReactNode | 无 |
| closeIcon | 自定义关闭图标,在 type="editable-card" 时有效 | ReactNode | 无 |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| closeIcon | 自定义关闭图标,在 type="editable-card" 时有效 | ReactNode ||
| closeIcon | 自定义关闭图标,在 `type="editable-card"` 时有效 | ReactNode ||

Choose a reason for hiding this comment

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

如果在一个Tabs里面的多个TabPane,需要固定几个TabPane不允许被关闭,其他都是可以关闭的,即:Tabs->type="editable-card",但是这样 所有的TabPane都可以出现关闭图标,可否在每个TabPane中设置不现实关闭图标,类似closeIcon={null}这样

Choose a reason for hiding this comment

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

sorry,刚看到应该在新版本中支持了,<TabPane tab={pane.title} key={pane.key} closable={pane.closable}>

@njmqd njmqd changed the base branch from feature to master May 9, 2020 08:13
@afc163
Copy link
Member

afc163 commented May 9, 2020

rebase master

@afc163
Copy link
Member

afc163 commented May 10, 2020

image

补充一下信息。

@afc163
Copy link
Member

afc163 commented May 11, 2020

feature branch

@njmqd njmqd force-pushed the feature-tabs-custom-closeIcon branch from 4c7f57d to 4cb70b6 Compare May 11, 2020 02:27
@njmqd njmqd requested a review from zombieJ as a code owner May 11, 2020 02:27
@yoyo837
Copy link
Contributor

yoyo837 commented May 11, 2020

Commits should be clean.

@njmqd njmqd changed the base branch from master to feature May 11, 2020 02:35
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.

希望Tabs.TabPane增加一个API可以自定义关闭图标
5 participants