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

Dropdown支持左右布局和原生组件交互 #6275

Open
faremax opened this issue Jul 31, 2023 · 3 comments
Open

Dropdown支持左右布局和原生组件交互 #6275

faremax opened this issue Jul 31, 2023 · 3 comments
Labels

Comments

@faremax
Copy link
Collaborator

faremax commented Jul 31, 2023

Version of antd-mobile

5.32.0

What is this feature about?

image

期望Dropdown组件支持如上图所示左右布局,Dropdown.Item组件增加align。Item中只要有一个传了align就变成了左右布局,其余没传的默认左对齐

<Dropdown>
  <Dropdown.Item key='1' title='选择' align="left" />
  <Dropdown.Item key='3' title='选择' align="left" />
  <Dropdown.Item key='2' title='选择' align="right" />
</Dropdown>

interface DropdownItemProps {
    align?: "left" | "right";
}

同时为和原生组件结合,Dropdown.Item 新增 onClick 事件和控制是否展示下拉遮罩的属性

interface DropdownProps {
  // 新增参数
  mask: boolean;
}

interface DropdownItemProps {
  // 新增参数
  onClick: () => void;
  mask: boolean;
}
@zombieJ
Copy link
Member

zombieJ commented Jul 31, 2023

Placeholder 是干什么的?

@zombieJ
Copy link
Member

zombieJ commented Jul 31, 2023

感觉是可以加强一下 Space 下的组合效果:

https://codesandbox.io/s/loving-hellman-g2lyf8?file=/app.tsx:208-243

@faremax
Copy link
Collaborator Author

faremax commented Jul 31, 2023

Placeholder 是干什么的?

上述接口方案内容已改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants