element-plus
element-plus copied to clipboard
[Style] [tabs, tab-pane] 给el-tabs__item的style添加 padding-lert right !important 导致只有一个ElTabPane的时候下划线长度计算错误
Bug Type: Style
Environment
- Vue Version:
3.4.27 - Element Plus Version:
2.7.3 - Browser / OS:
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0 - Build Tool:
Vite
Reproduction
Related Component
el-tabsel-tab-pane
Reproduction Link
Steps to reproduce
.demo-tabs {
.el-tabs__header {
.el-tabs__item {
padding-right: 20px !important;
padding-left: 20px !important;
}
}
}
What is Expected?
样式正常
What is actually happening?
样式错误
Additional comments
https://github.com/element-plus/element-plus/blob/f57b10c2ba89444c33b7a9d71842a78a0e14431d/packages/components/tabs/src/tab-bar.vue#L58C6-L58C35
似乎是这里的代码引起的,你可以选择自己提交PR或者等待其它人有时间来解决这个问题(需要考虑删除这一行带来的影响)