1.尝试设置 Antd 的样式优先级,使其正常工作。示例代码如下:
.ant-form-item-label { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; display: block; margin-bottom: 8px; font-weight: 400; }
.ant-form-item-label { --antd-form-item-label-max-width: 100px; max-width: var(--antd-form-item-label-max-width); width: clamp(0px, calc(100% - 24px), var(--antd-form-item-label-max-width)); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; display: block; margin-bottom: 8px; font-weight: 400; }