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 #986

Open
JeromeLin opened this issue Dec 6, 2022 · 9 comments
Open

新增下拉菜单组件 Dropdown #986

JeromeLin opened this issue Dec 6, 2022 · 9 comments
Labels
Milestone

Comments

@JeromeLin
Copy link
Collaborator

JeromeLin commented Dec 6, 2022

实现一个下拉菜单组件,点击菜单标题,向下(或向上)拉出内容区域,点击遮罩收回下拉内容。

示例如下:

image

Demo

import { Dropdown } from 'zarm';

render(
  <Dropdown>
    <Dropdown.Item key="key1" title="菜单一">内容一</Dropdown.Item>
    <Dropdown.Item key="key2" title="菜单二">内容二</Dropdown.Item>
  </Dropdown>
);

Props

export interface DropdownProps {
  actively?: number | string;
  defaultActiveKey?: number | string;
  onChange?: (activeKey: number | string) => void;
  arrow?: ReactNode;
}

export interface DropdownItemProps {
  key?: number | string;
  title?: ReactNode;
  arrow?: ReactNode;
}

API

Dropdown

属性 类型 默认值 说明
activeKey number | string - 激活的 Item Key
defaultActiveKey number | string - 默认激活的 Item Key
onChange (activeKey: number | string) => void - activeKey 变化时触发的回调函数
arrow ReactNode - 箭头样式

DropdownItem

属性 类型 默认值 说明
key number | string - 唯一值
title ReactNode - 标题
arrow ReactNode - 箭头样式
@JeromeLin JeromeLin added 💡 feature 功能需求 🔥 new component 新组件 labels Dec 6, 2022
@JeromeLin JeromeLin mentioned this issue Dec 6, 2022
86 tasks
@JaysonZou
Copy link
Contributor

我来做这个~ @JeromeLin

JaysonZou added a commit to JaysonZou/zarm that referenced this issue Dec 27, 2022
@JeromeLin
Copy link
Collaborator Author

@ifujustayup 好的,赞~

JaysonZou added a commit to JaysonZou/zarm that referenced this issue Dec 28, 2022
JaysonZou added a commit to JaysonZou/zarm that referenced this issue Dec 28, 2022
JaysonZou added a commit to JaysonZou/zarm that referenced this issue Dec 29, 2022
JaysonZou added a commit to JaysonZou/zarm that referenced this issue Jan 5, 2023
@qiaogaolong
Copy link

@JeromeLin 请问这个组件开发完成了嘛

@qiaogaolong
Copy link

@ifujustayup 请问这个组件开发完成了嘛

@JaysonZou
Copy link
Contributor

@ifujustayup 请问这个组件开发完成了嘛

@qiaogaolong 今天会搞完提pr的

@qiaogaolong
Copy link

@ifujustayup 嗯呐

JaysonZou added a commit to JaysonZou/zarm that referenced this issue Feb 4, 2023
JaysonZou added a commit to JaysonZou/zarm that referenced this issue Feb 4, 2023
JaysonZou added a commit to JaysonZou/zarm that referenced this issue Feb 8, 2023
@qiaogaolong
Copy link

这个可以了嘛

@JeromeLin
Copy link
Collaborator Author

@qfta1 PR有问题,需要重新修改。

@qiaogaolong 还不行

@qiaogaolong
Copy link

@qfta1 这个组件是否可以重新修改一下呢 都等着呢

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

3 participants