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

fix(components): [menu] Add menu-item margin when calculating calcSliceIndex #15699

Merged
merged 3 commits into from Jan 31, 2024

Conversation

zhixiaotong
Copy link
Contributor

@zhixiaotong zhixiaotong commented Jan 29, 2024

Fixes #15698

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

Copy link

👋 @zhixiaotong, seems like this is your first time contribution to element-plus.

  • Please make sure that you have read our guidelines and code of conduct before making a contribution.
  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

@pull-request-triage pull-request-triage bot added 1st contribution Their very first contribution Needs Review labels Jan 29, 2024
Copy link

Hello @zhixiaotong, thank you for contributing to element-plus, please see our guideline to see how to make contribution

Copy link

github-actions bot commented Jan 29, 2024

@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label Jan 29, 2024
Copy link

github-actions bot commented Jan 29, 2024

🧪 Playground Preview: https://element-plus.run/?pr=15699
Please comment the example via this playground if needed.

@zhixiaotong zhixiaotong changed the title fix(components): [menu] Add menu-item margin when calculating `calcSl… fix(components): [menu] Add menu-item margin when calculating calcSliceIndex Jan 29, 2024
@zhixiaotong
Copy link
Contributor Author

@kooriookami 打搅了。有几个问题想问下:

  • 为啥每一次提交都是first commit,这个怎么分辨的呢?

  • github上的单元测试为什么会失败,我本地执行了是成功的。 (;′⌒`)
    image

@kooriookami
Copy link
Member

我不知道怎么判定第一次贡献的,这个是自动打上的tag。

image相关的单元测试有点问题,经常容易失败,多跑几次可能就好了。

@zhixiaotong
Copy link
Contributor Author

我不知道怎么判定第一次贡献的,这个是自动打上的tag。

image相关的单元测试有点问题,经常容易失败,多跑几次可能就好了。

谢谢,如果不影响就没啥问题。我这个又跑了两次,还是失败。。

@zhixiaotong
Copy link
Contributor Author

@kooriookami 帮忙review下呢,谢谢!我也不知道这个流程是怎么样的。好在单元测试过了~

这个代码我本地已经打了个补丁包用于生产环境了,目前还在用2.4.4的补丁包,新的大量代码重构导致我不确定是否有新的bug产生~⊙﹏⊙

@kooriookami kooriookami requested a review from a team January 30, 2024 03:01
@kooriookami
Copy link
Member

不是特别奇怪的使用,不会有bug

@zhixiaotong
Copy link
Contributor Author

zhixiaotong commented Jan 30, 2024

不是特别奇怪的使用,不会有bug

是的,我们项目覆盖了epel-menu的展现和选中样式,菜单之间有margin就会存在这类问题。项目已经进测试阶段了,等后面新开的项目再考虑升级。

@kooriookami
Copy link
Member

这种写法依然保证不了特殊的布局,更好的做法是计算item父容器的宽度,可能改动比较大。

@zhixiaotong
Copy link
Contributor Author

这种写法依然保证不了特殊的布局,更好的做法是计算item父容器的宽度,可能改动比较大。

嗯,目前item父是ul包含了省略的菜单的宽度,事实上,如果计算了more菜单的宽度加上每个菜单item的宽度,加起来就是父元素宽度了。

@zhixiaotong zhixiaotong requested a review from btea January 31, 2024 02:00
@kooriookami kooriookami merged commit 2d15111 into element-plus:dev Jan 31, 2024
8 checks passed
@element-bot element-bot mentioned this pull request Feb 2, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Component] [menu] el-menu计算More省略菜单时,减去的每一个菜单宽度错误
3 participants