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(amis): DropDownButton 下拉菜单buttons支持动态解析 #6908

Merged
merged 1 commit into from
May 17, 2023

Conversation

z1769057083
Copy link
Contributor

@z1769057083 z1769057083 commented May 17, 2023

What

🤖 Generated by Copilot at f5229fb

Enhanced DropDownButton component to support dynamic buttons. Used resolveVariableAndFilter to parse buttons prop in packages/amis/src/renderers/DropDownButton.tsx.

🤖 Generated by Copilot at f5229fb

To make DropDownButton more clever
We added dynamic rendering lever
We used resolveVariableAndFilter
To parse buttons without a quiver
And renamed some props for good measure

Why

How

🤖 Generated by Copilot at f5229fb

  • Import and use resolveVariableAndFilter function to parse buttons prop of DropDownButton component if it is a string expression (link, link, link, link, link)
  • Check disabled and btnDisabled props before opening dropdown menu in open method of DropDownButton component (link)
  • Pass parsed buttons prop to mouseleave event data in close method of DropDownButton component (link)
  • Rename buttons prop to _buttons to avoid confusion with local variable in render method of DropDownButton component (link)

@github-actions github-actions bot added the feat label May 17, 2023
@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.

@hsm-lv hsm-lv merged commit 9c38268 into baidu:master May 17, 2023
5 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

3 participants