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(components): [tabs] add addIcon slot #12970

Merged
merged 4 commits into from
Sep 19, 2023
Merged

feat(components): [tabs] add addIcon slot #12970

merged 4 commits into from
Sep 19, 2023

Conversation

btea
Copy link
Collaborator

@btea btea commented May 29, 2023

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

Description

🤖 Generated by Copilot at f6cca1c

Added a new addIcon slot to the Tabs component and updated the documentation accordingly. This slot enables users to customize the appearance of the add button for editable tabs.

Related Issue

feat #11795 .

Explanation of Changes

🤖 Generated by Copilot at f6cca1c

  • Add a new slot addIcon to the Tabs component to allow customizing the icon of the add button for editable tabs (link, link, link)
  • Render the addIcon slot in the tabs.tsx file if it is provided, or fall back to the default plus icon (link)

@github-actions
Copy link

github-actions bot commented May 29, 2023

@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label May 29, 2023
@github-actions
Copy link

github-actions bot commented May 29, 2023

🧪 Playground Preview: https://element-plus.run/?pr=12970
Please comment the example via this playground if needed.

@btea btea requested a review from ryuhangyeong July 27, 2023 01:45
Copy link
Member

@ryuhangyeong ryuhangyeong left a comment

Choose a reason for hiding this comment

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

Personally, I think the function is useful, but I think it would be better to get a prop rather than a slot.

How about this?

@btea
Copy link
Collaborator Author

btea commented Jul 29, 2023

Personally, I think the function is useful, but I think it would be better to get a prop rather than a slot.

How about this?

Do you mean to add a prop similar to actionIcon, and then the default value is Plus?

This seems to be possible, but in this case, if the user wants to customize the element structure, it seems to be more troublesome. 🤔

@ryuhangyeong
Copy link
Member

Personally, I think the function is useful, but I think it would be better to get a prop rather than a slot.

How about this?

Do you mean to add a prop similar to actionIcon, and then the default value is Plus?

This seems to be possible, but in this case, if the user wants to customize the element structure, it seems to be more troublesome. 🤔

my opinion

From the name addicon, I already got the impression that only icons are available.

And since the area is not long, I think it is difficult to use it as a custom area.

I'd love to hear more people's opinions!

@btea
Copy link
Collaborator Author

btea commented Jul 29, 2023

From the name addicon, I already got the impression that only icons are available.

I just gave an example, maybe you can customize the text, such as Add. However, as you said, the area is not long, maybe it is better to only support icons. 🤔

@btea btea merged commit db16e31 into dev Sep 19, 2023
10 checks passed
@btea btea deleted the feat/tabs-add-slot branch September 19, 2023 05:33
@element-bot element-bot mentioned this pull request Oct 13, 2023
3 tasks
consultation-applio pushed a commit to consultation-applio/element-plus that referenced this pull request Nov 10, 2023
* feat(components): [tabs] add addIcon slot

* docs: add example

* docs: update tabs.md

* chore: add version tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CommitMessage::Qualified Qualified commit message
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants