ant-design-mobile icon indicating copy to clipboard operation
ant-design-mobile copied to clipboard

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

Open faremax opened this issue 1 year ago • 3 comments

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;
}

faremax avatar Jul 31 '23 05:07 faremax

Placeholder 是干什么的?

zombieJ avatar Jul 31 '23 07:07 zombieJ

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

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

zombieJ avatar Jul 31 '23 07:07 zombieJ

Placeholder 是干什么的?

上述接口方案内容已改

faremax avatar Jul 31 '23 10:07 faremax