如何避坑tab组件上的字重变大后 tab位置偏移

25 阅读1分钟

添加如下伪元素到tab按钮上

button {
            &::before {
                display: block;
                content: attr(title);
                font-weight: 500;
                height: 0;
                overflow: hidden;
                visibility: hidden;
                margin-bottom: -1px;
            }
}