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: Tabs组件title支持schema #7212

Merged
merged 11 commits into from
Jun 21, 2023
Merged

Conversation

sqzhou
Copy link
Collaborator

@sqzhou sqzhou commented Jun 18, 2023

What

🤖 Generated by Copilot at aa61cec

This pull request enhances the Tabs component in amis-ui and amis packages. It fixes some touch-related bugs, allows non-string and dynamic tab titles, and supports schema-based tab rendering.

🤖 Generated by Copilot at aa61cec

Sing, O Muse, of the skillful work of the code-smiths
Who fixed the bugs and enhanced the Tabs component
That displays the glorious deeds of heroes and gods
With dynamic and schema-based titles, like stars in the sky.

Why

How

🤖 Generated by Copilot at aa61cec

  • Import noop function and use it as fallback for touch event handlers (link, link)
  • Check title prop type before calling handleStartEdit on double click (link)
  • Allow title prop in TabSchema to be either a string or a SchemaNode (link)
  • Use render prop to render schema titles in renderTabs method (link)
  • Interpolate title prop with data in sourceTabs array (link)
  • Pass original title prop to Tab component (link)

@github-actions
Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@github-actions github-actions bot added the feat label Jun 18, 2023
@sqzhou sqzhou force-pushed the feat/tabs-title-schema branch 2 times, most recently from 20e8048 to ba1dc87 Compare June 19, 2023 07:06
hsm-lv
hsm-lv previously requested changes Jun 20, 2023
packages/amis/src/renderers/Tabs.tsx Show resolved Hide resolved
@wibetter wibetter dismissed hsm-lv’s stale review June 21, 2023 03:02

filter 中有判空,无需在这里进行重复的判空处理。filter(title, data) ?? render(tab-title/${index}, title, data) 改变了原有的逻辑,是有问题的写法。

@wibetter wibetter merged commit a76ae04 into baidu:master Jun 21, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants