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: support extra option #734

Merged
merged 8 commits into from
Aug 14, 2024
Merged

Conversation

coding-ice
Copy link
Contributor

@coding-ice
Copy link
Contributor Author

@afc163 佬,有空review一下~

src/utils/nodeUtil.tsx Outdated Show resolved Hide resolved

&-item {
display: flex;
justify-content: space-between;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items={[{
  label: <><span>内容</span><span>内容</span><>,
  extra: 'extra',
}]}

这种情况可能会有问题。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个问题依旧存在。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label 也得包一下。

Copy link
Contributor Author

@coding-ice coding-ice Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单独给extra,margin-left: auto了,不会存在了
image

Copy link
Contributor Author

@coding-ice coding-ice Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label 也得包一下。

这个,应该不能包裹,如果有用户使用子集选择器会出现问题

items={[{
  label: <p>内容</p>,
  extra: 'extra',
}]}

render:
<span><p>内容</p></span>
/* 失效 */
> p {

}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

佬,这个麻烦再看一眼,感觉应该没啥问题了~

src/interface.ts Outdated Show resolved Hide resolved
@coding-ice
Copy link
Contributor Author

coding-ice commented Aug 13, 2024

给extra加了一个cls选中它,不然css好像都会有点问题,因为都能自定义传入Node

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.59%. Comparing base (526a924) to head (8eedde2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #734   +/-   ##
=======================================
  Coverage   99.59%   99.59%           
=======================================
  Files          27       27           
  Lines         734      736    +2     
  Branches      200      202    +2     
=======================================
+ Hits          731      733    +2     
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@afc163
Copy link
Member

afc163 commented Aug 14, 2024

items={[{
  label: <><span>内容</span><span>内容</span><>,
  extra: 'extra',
}]}

这种情况好像渲染还是会不太对。

@coding-ice
Copy link
Contributor Author

原来是justify-content: space-between,已经改为margin-left: auto了,extra的左边距让它自适应,应该就可以避免这个问题了,效果图如下:

image image

@afc163 afc163 merged commit a05da80 into react-component:master Aug 14, 2024
9 checks passed
@afc163
Copy link
Member

afc163 commented Aug 14, 2024

哦,还有 README 里要补一下文档。

This was referenced Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants