-
Notifications
You must be signed in to change notification settings - Fork 59
feat: support options #164
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
Conversation
This pull request introduces 2 alerts when merging 1f66513 into 1924a3f - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 7222fc3 into 1924a3f - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #164 +/- ##
=======================================
Coverage 97.76% 97.77%
=======================================
Files 7 7
Lines 224 225 +1
Branches 44 46 +2
=======================================
+ Hits 219 220 +1
Misses 5 5
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
examples/basic.js
Outdated
<Option value="bamboo">Bamboo</Option> | ||
<Option value="cat">Cat</Option> | ||
</Mentions> | ||
items={[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/Option.tsx
Outdated
|
||
export interface OptionProps { | ||
value?: string; | ||
label?: string | React.ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
单独拆一个 ts 定义,否则 Mentions.Option 也会出现 label 的定义
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/DropdownMenu.tsx
Outdated
> | ||
{options.map((option, index) => { | ||
const { key, disabled, children, className, style } = option; | ||
const { key, disabled, className, style, label, children } = option; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data driven 后,这边只取 label 就好,这边 也把 children 转成 label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
This pull request fixes 1 alert when merging c2c6dd5 into 1924a3f - view on LGTM.com fixed alerts:
Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog. |
src/Mentions.tsx
Outdated
label?: string | React.ReactNode; | ||
key?: string; | ||
disabled?: boolean; | ||
children?: React.ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个就没 children 了,可以直接:
export interface DataDrivenOptionProps extends Omit<OptionProps, 'children'> {
label?: React.ReactNode;
}
This pull request fixes 1 alert when merging 01e2341 into 1924a3f - view on LGTM.com fixed alerts:
Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog. |
support items